Skip to content

Instantly share code, notes, and snippets.

@technoscavenger
Created December 4, 2019 01:39
Show Gist options
  • Save technoscavenger/0184746386b79b8ef825ae5ee6760082 to your computer and use it in GitHub Desktop.
Save technoscavenger/0184746386b79b8ef825ae5ee6760082 to your computer and use it in GitHub Desktop.
Get membership of a given Windows user
$query = "ASSOCIATORS OF {Win32_Account.Name='timus',Domain='mydomain'} WHERE ResultRole=GroupComponent ResultClass=Win32_Account"
Get-WMIObject -Query $query | Select Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment