Last active
September 5, 2015 15:31
-
-
Save Dan1el42/29c5966ab7ec5c2f0d85 to your computer and use it in GitHub Desktop.
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
| Param | |
| ( | |
| [Parameter(Mandatory = $true)] | |
| [String] $ComputerName | |
| ) | |
| # S-1-5-32-544 is the well-known security ID for the Administrators group | |
| $LocalGroup = Get-WmiObject -Class Win32_Group -Filter "SID = 'S-1-5-32-544'" -ComputerName $ComputerName | |
| if ($LocalGroup) | |
| { | |
| $LocalGroup.GetRelated('Win32_UserAccount') | |
| $LocalGroup.GetRelated('Win32_Group') | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment