View difference between Paste ID: wNsdyQDS and DLpKNcip
SHOW: | | - or go back to the newest paste.
1
$servers = Get-Content ‘serverlist.txt’
2
Write-Host
3
Write-Host "Issuing Patch Command to machine specified in serverlist.txt"
4
Write-Host
5
foreach ($server in $servers) {
6
Write-Host
7
Write-Host $server
8
Invoke-Command -Computer $server -ScriptBlock {schtasks /run /tn “PowerShell - Invoke Windows Updates”}
9
}
10
Write-Host