1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| $l = Import-Csv -Path ".\toto.csv" -Delimiter ";"
$date=Get-date
$date>>.\log.txt
$i=-1
foreach ($objet in $list) {
$i++
write-host $i
$comp=$objet.computers
if ((Test-Connection -Computername $comp -Quiet -Count 2) -and (get-hotfix -ComputerName $comp | where-object {$_.hotfixid -eq 'KB'}))
{
$typeos=(Get-WmiObject Win32_OperatingSystem -computername $Comp).OSArchitecture
$comp+': KBdéjà installée,, version OS :'+$typeos >> .\log.txt
$list[$i].fait="FAIT"
$list[$i].computers="********"
*
*
*
$l | export-csv -Path ".\toto.csv" -Delimiter ";"
Write-host "FINISH" |
Partager