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
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