Last active
June 7, 2019 10:30
-
-
Save manualbashing/374307ea41112a20ca87 to your computer and use it in GitHub Desktop.
Use cim to find local admin accounts on a Windows system.
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
Get-CimInstance -ClassName win32_group ` | |
-Filter "Name LIKE 'admin%' AND Domain = '$env:COMPUTERNAME'" | | |
Get-CimAssociatedInstance -Association win32_groupuser | | |
Select-Object -ExpandProperty Name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment