Apr 16 2021 01:56 AM
I was asked to fetch few user's Group membership Across the Domain. I am trying to do it through the Powershell But did not get any idea.can anyone please help one with that?
Thanks Sanjeev
Apr 16 2021 05:19 AM
Not sure, in what environment you are looking this functionality.
Use the below command in On-Premises Active Directory.
Get-ADPrincipalGroupMembership UserName | Select Name
Use the below command in Azure Active Directory.
$objectId = (Get-AzureADUser -SearchString "user@contoso.com").ObjectId
Get-AzureADUserMembership -ObjectId $objectId
Apr 16 2021 12:31 PM