Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #This will prompt for the security Hotfix ID
  2. $KB = read-host "Enter a hotfixID"
  3. #
  4. #List of computers are in CSV format here
  5. Import-Csv C:\serverlist.csv | foreach {
  6.     $server = $_.Server
  7.     $os = (get-adcomputer -filter "Name -eq '$server'" -Properties OperatingSystem  | Select OperatingSystem).OperatingSystem
  8.  
  9.     [pscustomobject]@{
  10.         Server=$Server
  11.         OS=$OS
  12.         Installed=(Get-HotFix -ComputerName $Server -Id $KB -ErrorAction Ignore) -ne $null
  13.     }
  14. } | Export-csv C:\results.csv -NoTypeInformation
  15. #
  16. #EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement