Skip to content

Instantly share code, notes, and snippets.

@belotn
Created March 26, 2014 16:04
Show Gist options
  • Save belotn/9786817 to your computer and use it in GitHub Desktop.
Save belotn/9786817 to your computer and use it in GitHub Desktop.
List failure option of a service
get-xaserver |% {
gwmi Win32_Service -ComputerNAme $_.ServerName -Filter 'Name="cpsvc"' } |select __SERVER,@{N="failure";E={
(sc.exe \\$($_.__SERVER) qfailure $($_.Name) | select-string 'FAILURE') -ne $null
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment