Created
March 8, 2019 10:12
-
-
Save spy86/88fe097310c9820d115d7cdebaaf9af0 to your computer and use it in GitHub Desktop.
GetLocalAdminGroupMembers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| invoke-command { | |
| $members = net localgroup administrators | | |
| where {$_ -AND $_ -notmatch "command completed successfully"} | | |
| select -skip 4 | |
| New-Object PSObject -Property @{ | |
| Computername = $env:COMPUTERNAME | |
| Group = "Administrators" | |
| Members=$members | |
| } | |
| } -computer chi-fp01,chi-win8-01,chi-ex01 -HideComputerName | | |
| Select * -ExcludeProperty RunspaceID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment