You are viewing limited content. For full access, please sign in.

Question

Question

How to get the trusted domain accounts for a repository?

asked on December 16, 2014

Below is the old LFSO code. I am trying to duplicate this with RA. I can not find a similar property to TrustedDomainAccounts. Also, I'm assuming I should use the AccountReferenceCollection object to hold the trusted accounts?

trusteeNames = new List<string>();

ILFGrantedDomainAccountCollection TrustedAccounts = null;
TrustedAccounts = (ILFGrantedDomainAccountCollection)this._lfDatabase.TrustedDomainAccounts;
foreach (ILFTrustee trustee in TrustedAccounts)
{
    trusteeNames.Add(trustee.Name);
}

 

0 0

Answer

SELECTED ANSWER
replied on December 17, 2014

To get a list of the explicitly trusted Windows accounts in your repository, the Trustee class has an EnumGrantedWindowsAccounts method. So as a sample way to list out the explicitly trusted Windows groups/users in your repository, you can do something similar to

List<string> trusteeNames = new List<string>();

WindowsAccountReader TrustedAccounts = Trustee.EnumGrantedWindowsAccounts(Session);
foreach (TrusteeInfo trustee in TrustedAccounts)
{
    System.Security.Principal.SecurityIdentifier sid = new System.Security.Principal.SecurityIdentifier(trustee.Sid.ToString());
    System.Security.Principal.NTAccount act = (System.Security.Principal.NTAccount)sid.Translate(typeof(NTAccount));
    trusteeNames.Add(act.Value);
}

 

1 0

Replies

replied on December 17, 2014

I wish there was a comparison somewhere of LFSO objects related to RA objects.

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.