Working with Active Users

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arvind P Rangan

    Working with Active Users

    Hi all,

    I am working on a project which checks for windows login and its rights and
    then opens up the rest of the forms according to the login and the rights
    already set in the windows.

    I just know that this can be done using Active Directory Class can anyone
    who has worked on it give me web links or few examples to start with.

    Thanks
    Arvind.


  • Greg Ewing [MVP]

    #2
    Re: Working with Active Users

    Arvind, there are a couple of ways you can do this depending on what you
    need exactly. Have you checked out the WindowsIdentity class for instance?
    That might have all that you need in it.

    If you need to know all of their groups you can do something like this if
    you have the user's LDAP/AD path :

    string UserPath = "LDAP://cn=Arvind,ou=De pt,dc=Company,d c=com"

    // bind to the user
    DirectoryEntry User = new DirectoryEntry( UserPath );

    // enumerate all the user's groups
    foreach(string GroupName in User .Properties["memberOf"])
    {
    Console.WriteLi ne(GroupName);
    }

    --
    Greg Ewing [MVP]
    Accomplish Your Mission with Better IT | IT support for nonprofits. You deserve peace of mind. National and remote outsourced nonprofit IT.


    "Arvind P Rangan" <arvind99@hotma il.com> wrote in message
    news:#PvkmWefDH A.2748@TK2MSFTN GP11.phx.gbl...[color=blue]
    > Hi all,
    >
    > I am working on a project which checks for windows login and its rights[/color]
    and[color=blue]
    > then opens up the rest of the forms according to the login and the rights
    > already set in the windows.
    >
    > I just know that this can be done using Active Directory Class can anyone
    > who has worked on it give me web links or few examples to start with.
    >
    > Thanks
    > Arvind.
    >
    >[/color]


    Comment

    Working...