problem getting User Group Memebership in Active Directory

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default problem getting User Group Memebership in Active Directory

    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 [url]http://www.developersdex.com[/url] ***
    Patrick Olurotimi Ige Guest

  2. Similar Questions and Discussions

    1. Use CFLDAP to Add user onto Active Directory
      How do you change a password? What I found out so far was that the password must be: - enclosed in quotes - converted to unicode then base64 -...
    2. problem accesing Active Directory from an ASP.NET App when user has been authenticated via AD certificate mapping
      hello, I am developing an ASP.NET web application which interacts withAD. Client/User authentication must be done via AD certificatemapping, so I...
    3. Help me! How I could make user in active directory
      The canonical sample is right here in the MSDN docs: ...
    4. User Authentication, Active Directory and more (help)
      Hi, Can a .NET application make use of the information within the Active Directory in order to Authenticate and Authorize users? For example...
    5. Exporting users that below to a certain group - windows 2003 active directory
      Is there any tool or script that will export the users names from a certain group from the active directory? I tried ldifde but it exports the cn...
  3. #2

    Default Re: problem getting User Group Memebership in Active Directory

    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" <naijacoder@hotmail.com> wrote in message
    news:OSQAAUFVFHA.3312@TK2MSFTNGP09.phx.gbl...
    >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 [url]http://www.developersdex.com[/url] ***

    Joe Kaplan \(MVP - ADSI\) Guest

  4. #3

    Default Re: problem getting User Group Memebership in Active Directory

    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 [url]http://www.developersdex.com[/url] ***
    Patrick Olurotimi Ige Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139