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.