Skip to content

Instantly share code, notes, and snippets.

@sowderca
Created May 17, 2021 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sowderca/81f68c4f29a1209e33c8694bfbc2586a to your computer and use it in GitHub Desktop.
Save sowderca/81f68c4f29a1209e33c8694bfbc2586a to your computer and use it in GitHub Desktop.
local admins
Get-CimInstance -ComputerName $ComputerName -Namespace 'root/cimv2' -QueryDialect 'WQL' -Query "associators of {Win32_Group.Domain='$($ComputerName)',Name='Administrators'} where Role=GroupComponent";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment