How to get list of user in a group which is another forest?

Viewed 69

I have a domain local group that is a part of domain 1 in forest A.

I am trying to iterate all the members in this group (including users and Groups). It iterates through all the domains of forest A just fine, but does not iterate any members of the group that are in domain 2, in forest 2.

To address this I have written the following code:

var sidString = "Valid SID";
IdentityReference id = new SecurityIdentifier(sidString);

var account = id.Translate(typeof(NTAccount)).ToString().Split('\\');

var userName = account[1];
var domainName = account[0];

Now the problem here is, i have Group which is of Domain 2 in Forest 2. which is nested in to a Group which is in Domain 1 in Forest 1. If i am using the above code for a group it is retrieving Group Name and Domain name for a particular SID.

But what i want is list of users which are part of that Group.

0 Answers
Related