Skip to content

Posts from the ‘Active Directory’ Category

5
Jul

Get-AdUser Group Membership

Quick snippit to grab a users’ group membership:

Get-ADUser -filter{samaccountname -eq 'snewman'} -Properties MemberOf | select -ExpandProperty MemberOf | %{$_.ToString().Split(',')[0].Replace('CN=', '');}