Using ASP.Net to Get User Information from AD

Discussion in 'ASP .Net' started by Derek Martin, Apr 20, 2005.

  1. Derek Martin

    Derek Martin Guest

    (Sorry, cross posted on accident)

    Hey list, got this code running in a webform:

    Dim DSESearcher As System.DirectoryServices.DirectorySearcher = New
    System.DirectoryServices.DirectorySearcher
    Dim RootDSE As String = DSESearcher.SearchRoot.Path
    RootDSE = RootDSE.Insert(7, "ou=users,ou=myusers,")
    Dim myDE As DirectoryEntry = New DirectoryEntry(RootDSE)
    Dim myEntries As DirectoryEntries = myDE.Children
    Dim thisentry As DirectoryEntry
    thisentry = myEntries.Find("cn=" & lastname)
    Label1.Text = thisentry.Name

    Obviously, this won't work because it's running as the ASP.Net user. How do
    I go about getting another or hardcoded user to authenticate with
    DSESearcher?

    Thanks!
    Derek
     
    Derek Martin, Apr 20, 2005
    #1
    1. Advertising

  2. Derek Martin

    Guest

    Try

    Dim myDE As DirectoryEntry = New DirectoryEntry(strLDAPPath,
    strUserName, strPassword,
    System.DirectoryServices.AuthenticationTypes.Secure)

    Bill E.
    Hollywood, FL
     
    , Apr 20, 2005
    #2
    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. z. f.
    Replies:
    0
    Views:
    714
    z. f.
    Feb 3, 2005
  2. =?Utf-8?B?S3VtYXI=?=

    Get remote server system information using asp.net,c#

    =?Utf-8?B?S3VtYXI=?=, Feb 25, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    18,589
    vikastripathi
    Oct 6, 2012
  3. Eric Layman
    Replies:
    3
    Views:
    579
    sloan
    May 10, 2007
  4. mazdotnet
    Replies:
    1
    Views:
    581
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 7, 2007
  5. ShilpaM
    Replies:
    1
    Views:
    280
    Joe Kaplan
    Jan 18, 2007
Loading...

Share This Page