grabbing current username via ADSI?

Discussion in 'ASP General' started by Tom Petersen, Jan 18, 2005.

  1. Tom Petersen

    Tom Petersen Guest

    My users logon to the Patriot domain, my intranet is on sdsddata01 server.
    I have a form that people have to click on a dropdown list to pick their
    name from the list when submitting a form. Is there any way to grab their
    username via ADSI so I can query it against a database that will get
    submitted against a form. I have seen a few arcticles regarding this but I
    couldn't make sense of them. They are already authenticating when they
    login, so I don't want them to have to do it again once they hit the
    intranet. Is this possible using ADSI? Will I have to make some permission
    changes in IIS as well?

    TIA!
    Tom
    Tom Petersen, Jan 18, 2005
    #1
    1. Advertising

  2. "Tom Petersen" <> wrote in message
    news:OJAjRTW$...
    > My users logon to the Patriot domain, my intranet is on sdsddata01 server.
    > I have a form that people have to click on a dropdown list to pick their
    > name from the list when submitting a form. Is there any way to grab their
    > username via ADSI so I can query it against a database that will get
    > submitted against a form. I have seen a few arcticles regarding this but

    I
    > couldn't make sense of them. They are already authenticating when they
    > login, so I don't want them to have to do it again once they hit the
    > intranet. Is this possible using ADSI? Will I have to make some

    permission
    > changes in IIS as well?


    In ASP, Request.ServerVariables("LOGON_USER") captures the username as long
    as you have denied anonymous access.
    Tom Kaminski [MVP], Jan 18, 2005
    #2
    1. Advertising

  3. Tom Petersen

    Mike D Guest

    Use
    Function PullUserFullname(strUser)
    Dim User
    Set User = GetObject("WinNT://<your domain>/" & strUser & ",user")
    PullUserFullname = User.Fullname
    End Function

    from http://www.15seconds.com/issue/020130.htm

    HTH
    Mike


    "Tom Petersen" wrote:

    > My users logon to the Patriot domain, my intranet is on sdsddata01 server.
    > I have a form that people have to click on a dropdown list to pick their
    > name from the list when submitting a form. Is there any way to grab their
    > username via ADSI so I can query it against a database that will get
    > submitted against a form. I have seen a few arcticles regarding this but I
    > couldn't make sense of them. They are already authenticating when they
    > login, so I don't want them to have to do it again once they hit the
    > intranet. Is this possible using ADSI? Will I have to make some permission
    > changes in IIS as well?
    >
    > TIA!
    > Tom
    >
    >
    >
    Mike D, Jan 18, 2005
    #3
  4. Tom Petersen

    Jeff Cochran Guest

    On Tue, 18 Jan 2005 07:54:24 -0600, "Tom Petersen"
    <> wrote:

    >My users logon to the Patriot domain, my intranet is on sdsddata01 server.
    >I have a form that people have to click on a dropdown list to pick their
    >name from the list when submitting a form. Is there any way to grab their
    >username via ADSI so I can query it against a database that will get
    >submitted against a form. I have seen a few arcticles regarding this but I
    >couldn't make sense of them. They are already authenticating when they
    >login, so I don't want them to have to do it again once they hit the
    >intranet. Is this possible using ADSI?


    Yes, but easier using just ASP and Request.ServerVariables.

    >Will I have to make some permission
    >changes in IIS as well?


    You have to turn off Anonymous access, otherwise the user won't
    authenticate using Windows credentials for you to retrieve.

    Jeff
    Jeff Cochran, Jan 18, 2005
    #4
    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. darrel
    Replies:
    4
    Views:
    471
    darrel
    Jul 7, 2004
  2. Chris Kennedy

    ADSI via .net

    Chris Kennedy, Jul 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,708
    Shiva
    Jul 25, 2004
  3. ChaosKCW
    Replies:
    1
    Views:
    273
    Larry Bates
    Feb 25, 2006
  4. Shailesh Patel
    Replies:
    0
    Views:
    429
    Shailesh Patel
    Nov 8, 2006
  5. Ryan Ritten

    ASP grabbing windows username

    Ryan Ritten, Jun 7, 2004, in forum: ASP General
    Replies:
    3
    Views:
    107
    Egbert Nierop \(MVP for IIS\)
    Jun 8, 2004
Loading...

Share This Page