Created
April 28, 2022 03:02
-
-
Save santisq/1d8461a2d0baa9ed6ac40fe77f8f7da0 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
| Get-CimInstance Win32_UserAccount | ForEach-Object { | |
| $membership = Get-CimAssociatedInstance $_ -ResultClassName Win32_Group | |
| [pscustomobject]@{ | |
| Computername = $Env:COMPUTERNAME | |
| UserName = $_.Name | |
| Memberof = $membership.Name -join ';' | |
| Status = $membership.Name -contains 'Administrators' | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment