Get ADUserGroup - PPOSHGROUP/PPoShDemo GitHub Wiki
PPoShDemo -> Get-ADUserGroup.ps1
Retrieves all groups user belongs to from specified OU.
Get-ADUserGroup [-Identity] <String[]> [[-SearchOU] <String>]
[<CommonParameters>]Retrieves all groups user belongs to from specified OU. If no OU is specified then domain root is set as default.
Can take username or multiple usernames as a parameter.
- PipelineInput: true (ByValue, ByPropertyName)
- Required: true
Expects DN of an OU. If not provided will deafult to root domain DN.
- DefaultValue: (Get-ADDomain).DistinguishedName
- PipelineInput: false
- Required: false
Get-ADUserGroup -Identity 'someuser'Will query for all groups 'someuser' belongs to in current Domain
Get-ADUserGroup -Identity 'someuser' -SearchOU 'OU=Security Groups,OU=SOME_OU,DC=corp,DC=org'Will query for all groups from Security Groups in SOME_OU 'someuser' belongs to in current Domain.