
To list the local administator accounts, you can just use the group membership command
1Get-LocalGroupMember -Group "Administrators"
1ObjectClass Name PrincipalSource
2----------- ---- ---------------
3User MyPC\Administrator Local
4User MyPC\Ben MicrosoftAccount

Comments