06 July,2020 by Tom Collins
Question: I use the Powershell cmdlet Get-ADPrincipalGroupMembership to get AD group membership of IDs within the current domain, but how can I use Get-ADPrincipalGroupMembership to check the membership of an ID in another domain?
Answer: Yes , The Get-ADPrincipalGroupMembership cmdlet will return the group membership of the specified user , in the current domain of the logon executing this cmdlet . To access the group membership of a specific ID , you'll need to use the -server switch .
Example
Get-ADPrincipalGroupMembership 'ID1' -Server 'anotherdoamin' | select name
If you want to read on how to access the group membership of an ID in the current domain - How to get the Active Directory groups membership for user with Powershell
Read more on Powershell and Active Directory
How to Export Active Directory Group Members with Powershell Get-ADGroupMember
Powershell Active Directory search
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |