Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

get just the group user is a member of

$
0
0

I need to get just the groups a user is a member of from AD.  I've tried a few things like this:

(get-aduser USERNAME -Properties*).MemberOf
(GET-ADUSER–Identity USERNAME –Properties MemberOf | Select-Object MemberOf).MemberOf

but both return the full path, example:

CN=*Acme - Recipients,OU=Distribution Lists,OU=Slatter,DC=acme,DC=org

I only want to capture the *Acme - Recipients and nothing else.

Thank you.  

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles