I am using this code to get groups for a user and getting a error (5) on the
GetAuthorizatio nGroups() function .
There are two domains.
This function works on the local domain but does not work on the other domain.
Other functions work on the other domain like get all the users and get all
the groups and I can validate users on the other domain so I think I am
communciating with the other domain OK just not with the
GetAuthorizatio nGroups() function.
ArrayList results = new ArrayList();
PrincipalContex t context = new PrincipalContex t(ContextType.D omain, null,
_DomainDN, _UserName, _Password);
UserPrincipal p =
UserPrincipal.F indByIdentity(c ontext,Identity Type.SamAccount Name, username);
var groups = p.GetAuthorizat ionGroups();
foreach (GroupPrincipal group in groups)
{
results.Add(gro up.SamAccountNa me);
}
I can use the p.GetGroups() function and it will work.
I cannot find much on this GetAuthorizatio nGroups function and nothing on
the error.
Thank you,
--
Jerry
GetAuthorizatio nGroups() function .
There are two domains.
This function works on the local domain but does not work on the other domain.
Other functions work on the other domain like get all the users and get all
the groups and I can validate users on the other domain so I think I am
communciating with the other domain OK just not with the
GetAuthorizatio nGroups() function.
ArrayList results = new ArrayList();
PrincipalContex t context = new PrincipalContex t(ContextType.D omain, null,
_DomainDN, _UserName, _Password);
UserPrincipal p =
UserPrincipal.F indByIdentity(c ontext,Identity Type.SamAccount Name, username);
var groups = p.GetAuthorizat ionGroups();
foreach (GroupPrincipal group in groups)
{
results.Add(gro up.SamAccountNa me);
}
I can use the p.GetGroups() function and it will work.
I cannot find much on this GetAuthorizatio nGroups function and nothing on
the error.
Thank you,
--
Jerry
Comment