Created
August 24, 2017 03:55
-
-
Save tom-henderson/8473af7fc585330128f09cd690d2d4c1 to your computer and use it in GitHub Desktop.
Get computer's group membership without using the AD module
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
$searcher = [adsisearcher]"(&(objectCategory=computer)(cn=$env:COMPUTERNAME))" | |
$searcher.FindOne().Properties.memberof -replace '^CN=([^,]+).+$','$1' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment