Can I List Active Directory Group Members Across a One-Way Trust?

0
8
Asked By CuriousCoder92 On

I'm working with two domains where **Domain1** has a one-way trust relationship with **Domain2**. This means that while **Domain2** trusts **Domain1**, **Domain1** does not trust **Domain2**. I have a situation where **Domain2**'s **builtinAdministrators** group contains some members from **Domain1**. However, since **Domain2** isn't trusted by **Domain1**, those members appear as foreign objects, which is causing issues when I try to use the command `Get-ADGroupMember` to retrieve the members of the Administrators group from **Domain2**. It throws an internal error instead.

Interestingly, I can access and see the members of the Administrators group from **Domain1** using the ADUC console without any issues, while **Domain2** shows the foreign security principal SIDs as expected due to the trust. I have admin credentials for both domains, so I'm wondering if there's a way to compile a list of those group members despite these trust limitations. Any insights would be greatly appreciated!

2 Answers

Answered By TechGuru23 On

Absolutely, you can work around this issue! The error you're experiencing is due to how trusts and name resolution work. Since there's a one-way trust from **Domain1** to **Domain2**, **Domain2** can't automatically resolve those foreign security principals on its own when you use `Get-ADGroupMember` directly from it. Instead, try querying the raw `member` attribute of the group in **Domain2**. After that, pull the SIDs of these foreign objects and resolve them manually in **Domain1** using your admin credentials there. This way, you'll effectively bypass the trust issue!

ScripterSteve -

That sounds like a solid plan! Just make sure to query the `member` attribute directly and handle the SIDs carefully; there’s a bit of scripting you’ll have to do, but I’m sure you can handle it!

Answered By CodeCrafter88 On

Great advice! Just to add to that, when using PowerShell, you can use the `Get-ADDomain` command to identify your search base for querying the members based on their SID. Then, use `Get-ADObject` to extract their information in **Domain1**. Your approach should work well to compile the list you need!

TechGuru23 -

Exactly! That method will allow you to see the details of those members effectively. Just make sure your scripts are well-structured to handle any errors or exceptions that might come up during the query.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.