problem getting User Group Memebership in Active Directory

Discussion in 'ASP .Net Security' started by Patrick Olurotimi Ige, May 9, 2005.

  1. I have a .aspx page that gets USERS GROUPS from the Active Directory
    after inputing the USERNAME of the user in a textbox.

    And this has been working for me.
    But now i get the error:-

    "An Error occurred while getting group memberships
    The referenced account is currently locked out and may not be logged on
    to"

    An ideas what is wrong?




    *** Sent via Developersdex http://www.developersdex.com ***
     
    Patrick Olurotimi Ige, May 9, 2005
    #1
    1. Advertising

  2. It sounds like the referenced account may be locked. If you can show a
    short code sample that demonstrates this problem, that would be helpful.

    Joe K.

    "Patrick Olurotimi Ige" <> wrote in message
    news:...
    >I have a .aspx page that gets USERS GROUPS from the Active Directory
    > after inputing the USERNAME of the user in a textbox.
    >
    > And this has been working for me.
    > But now i get the error:-
    >
    > "An Error occurred while getting group memberships
    > The referenced account is currently locked out and may not be logged on
    > to"
    >
    > An ideas what is wrong?
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
     
    Joe Kaplan \(MVP - ADSI\), May 9, 2005
    #2
    1. Advertising

  3. Joe thanks for the reply but 'm getting the error when i try
    retrieving the GroupMemberships.
    Patrick


    private string[] GetGroupMemberships(string path, ref int
    primaryGroupID)
    {
    StringBuilder groupNames = new StringBuilder();
    try
    {
    DirectoryEntry entry = new DirectoryEntry(path);

    string[] properties = {"memberof", "primarygroupid"};

    entry.RefreshCache(properties);

    // invoke Groups method which will get all groups
    // user is member of even primary group

    object groups = entry.Invoke("Groups");

    // the read group name from collection
    foreach (object group in (IEnumerable)groups)
    {
    DirectoryEntry groupEntry = new DirectoryEntry(group);
    groupNames.Append(groupEntry.Name);
    groupNames.Append("|");
    groupEntry.Dispose();
    }

    // set primary group id
    primaryGroupID =
    Convert.ToInt32(entry.Properties["primarygroupid"].Value);
    entry.Dispose();
    }
    catch (Exception ex)
    {
    Response.Write("<font color=red>An Error occurred while
    getting group memberships. " +
    ex.Message + "</font>");
    Response.End();
    }
    return groupNames.ToString().TrimEnd(new char[]{'|'}).Split(new
    char[]{'|'});
    }



    *** Sent via Developersdex http://www.developersdex.com ***
     
    Patrick Olurotimi Ige, May 10, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Liming

    Memebership, Role, Profile Provider

    Liming, Jan 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    575
    john smith
    Jan 7, 2006
  2. zieg
    Replies:
    0
    Views:
    2,091
  3. Max2006
    Replies:
    3
    Views:
    461
    Steven Cheng[MSFT]
    Jul 9, 2007
  4. Jerry Qu

    changing the memebership data provider

    Jerry Qu, Aug 8, 2006, in forum: ASP .Net Security
    Replies:
    0
    Views:
    128
    Jerry Qu
    Aug 8, 2006
  5. Ken
    Replies:
    0
    Views:
    678
Loading...

Share This Page