Advertisement
easternnl

Check for SCOM agent on servers in a certain OU

Feb 8th, 2016
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Get-ADComputer -filter * -searchbase "OU=Servers,dc=testlabl,dc=local" |where { $_.name -notlike "*AV*"}  | foreach {
  2.  
  3. $result = gwmi -ComputerName "$($_.name)" win32_product | where { $_.name -ilike "*monitoring agent*"}  | select name,version
  4.  
  5. if ($result)
  6. { write-host -ForegroundColor White "$($_.name) Yes" }
  7. else
  8. { write-host -ForegroundColor Red "$($_.name) No"  }
  9.  
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement