locked
Primary user group issue in LDAP - Active Directory services RRS feed

  • Question

  • Hi,

    Am doing the vb6 to vb.net conversion, in which am facing issue with the LDAP.

    In vb6 I use the ActiveDS.dll to query the LDAP and get the User Groups. I got all the User Groups including the primary group “Domain Users”.

    Where as in vb.net I use the System.DirectoryServices to query the LDAP, in which am getting all the groups except the primary group “Domain Users”.

    Note: I use the “memberof ” property to get the groups.

    Could anyone help me to get the primary group “Domain Users” using the System.DirectoryServices concept.


    Thanks, Karthikeyan.V

    Wednesday, April 11, 2012 10:32 AM

Answers

All replies

  • Hi IceWar,

    Welcome to the MSDN Forum.

    Is there a group named "Domain Users" in your computer?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 16, 2012 3:20 AM
  • Hi Mike Feng,

    Below is the structure,

    In Control pannel, User Accounts --> Groups--> I have a group named "Users", which has the property as "XYZ\Domain Users", where XYZ is my domain name.

    So, what ever be the groups that are in the system, for a specific user id, i need to get the primary group name thats is added to that id.


    Thanks, Karthikeyan.V


    Monday, April 16, 2012 10:12 AM
  • Hi Icewar,

    If you want to retrieve a domain name of a specific user, please take a look at this thread: http://forums.asp.net/t/1258521.aspx/1 

    If you just want to get current user's domain name, it will be simpler: http://msdn.microsoft.com/en-us/library/system.environment.userdomainname.aspx 

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike Feng Saturday, April 21, 2012 7:30 AM
    Tuesday, April 17, 2012 5:49 AM