Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get NT UserName Not Working on Certain Servers

Status
Not open for further replies.

onetomany

Programmer
May 15, 2000
55
0
0
US
I am using the following function to get the NT user name.
I am using PWS.
It works fine on some servers but not on others(the one I need it on ). Am I doing something wrong or is there another way to get the Windows NT UserName that I can try

Function NTUserName()
on error resume next
'declare variables
Dim logon, myArray

'will return Domain\Username or just Username depending
'if the user is logged into the domain or their local machine.
logon = Request.ServerVariables("LOGON_USER")

'split the logon variable by the "\"
myArray = Split(logon, "\", -1, 1)

'take the upper bound of the logon variable
logon = myArray(Ubound(myarray))


NTUserName = logon




End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top