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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Identify Domain Name? 1

Status
Not open for further replies.

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)?
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top