mikedopp

windersUpdatesPS

Aug 24th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Add Comment
Please, Sign In to add comment