Created
March 8, 2019 10:12
-
-
Save spy86/3c03f7932d71ed73a832be8b5f2f7b22 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
| $members = net localgroup administrators | | |
| where {$_ -AND $_ -notmatch "command completed successfully"} | | |
| select -skip 4 | |
| New-Object PSObject -Property @{ | |
| Computername = $env:COMPUTERNAME | |
| Group = "Administrators" | |
| Members=$members | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment