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!

Get Domain Name

Status
Not open for further replies.

trevorwilliams2

Programmer
Mar 3, 2003
107
US
Anybody know of a function / way to retrieve the name of the current domain?
 
Try this:

Function GetData()
Dim wshNetWork
Dim strUserDomain
Dim strCompName

Set wshNetWork = CreateObject("WScript.Network")
strUserDomain = wshNetWork.UserDomain
strCompName = wshNetWork.computername
MsgBox "User Domain: " & strUserDomain & vbNewLine & "Computer Name: " & strCompName
End Function

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top