Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Get-ADPrincipalGroupMembership other domain

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 post first appeared on SQLSERVER-DBA.com, please read the originial post: here

Share the post

Get-ADPrincipalGroupMembership other domain

×

Subscribe to Sqlserver-dba.com

Get updates delivered right to your inbox!

Thank you for your subscription

×