Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not all Active Directory Groups showing up for User

Status
Not open for further replies.

spacedeveloper

Programmer
Aug 3, 2010
27
0
0
US
Hi All,

I'd really appreciate some help on this. It's got me a bit stumped.

I am trying to retrieve all of the Groups that I am a member of from Active Directory. The follow to pieces of code are ways that I am attempting to do this. It works very well with other users...but not for me! It used to!

Another thing is that when I do go into AD to check what groups I am a "Member Of"...I, indeed, DO belong to the very Group I am querying.

Here is the code I have been using to accomplish this:

Code:
ArrayList groups = new ArrayList();
foreach (System.Security.Principal.IdentityReference group in HttpContext.Current.Request.LogonUserIdentity.Groups)
{
     groups.Add(group.Translate(typeof(System.Security.Principal.NTAccount)).ToString());
}
...then code to iterate through the Groups to find the one I am looking for...

Any help would very much be appreciated.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top