May 24, 2002 #1 StewartJ Programmer Apr 3, 2002 74 GB Please can anyone tell me how to identify the domain name under which the user is logged on in NT4 (both local machine and server ae NT4)?
Please can anyone tell me how to identify the domain name under which the user is logged on in NT4 (both local machine and server ae NT4)?
Jun 14, 2002 1 #2 ide Programmer Apr 10, 2001 236 EU fe: from environment variables Sub WhoAmI() MsgBox Environ$("USERDOMAIN" & "\" & Environ$("USERNAME" End Sub or wscript: Sub WhoAmi0() Dim WSHNetwork Dim colDrives, SharePoint Dim CRLF CRLF = Chr(13) & Chr(10) Set WSHNetwork = CreateObject("WScript.Network" MsgBox "UserDomain" & Chr(9) & "= " & WSHNetwork.UserDomain & CRLF & _ "UserName" & Chr(9) & "= " & WSHNetwork.UserName & CRLF & _ "ComputerName" & Chr(9) & "= " & WSHNetwork.ComputerName End Sub ide Upvote 0 Downvote
fe: from environment variables Sub WhoAmI() MsgBox Environ$("USERDOMAIN" & "\" & Environ$("USERNAME" End Sub or wscript: Sub WhoAmi0() Dim WSHNetwork Dim colDrives, SharePoint Dim CRLF CRLF = Chr(13) & Chr(10) Set WSHNetwork = CreateObject("WScript.Network" MsgBox "UserDomain" & Chr(9) & "= " & WSHNetwork.UserDomain & CRLF & _ "UserName" & Chr(9) & "= " & WSHNetwork.UserName & CRLF & _ "ComputerName" & Chr(9) & "= " & WSHNetwork.ComputerName End Sub ide