Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   grabbing current username via ADSI? (http://www.velocityreviews.com/forums/t797654-grabbing-current-username-via-adsi.html)

Tom Petersen 01-18-2005 01:54 PM

grabbing current username via ADSI?
 
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 Kaminski [MVP] 01-18-2005 02:22 PM

Re: grabbing current username via ADSI?
 
"Tom Petersen" <petert@sdsd.sdbor.edu> wrote in message
news:OJAjRTW$EHA.2112@TK2MSFTNGP14.phx.gbl...
> 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.



Mike D 01-18-2005 08:31 PM

RE: grabbing current username via ADSI?
 
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
>
>
>


Jeff Cochran 01-18-2005 08:50 PM

Re: grabbing current username via ADSI?
 
On Tue, 18 Jan 2005 07:54:24 -0600, "Tom Petersen"
<petert@sdsd.sdbor.edu> 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


All times are GMT. The time now is 07:13 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.