Oct 6, 2010 #1 trevorwilliams2 Programmer Joined Mar 3, 2003 Messages 107 Location US Anybody know of a function / way to retrieve the name of the current domain?
Oct 6, 2010 #2 StarPassing Programmer Joined Oct 21, 2001 Messages 109 Location US 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 Upvote 0 Downvote
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
Oct 6, 2010 Thread starter #3 trevorwilliams2 Programmer Joined Mar 3, 2003 Messages 107 Location US Just what I needed. Works great. Thanks! Upvote 0 Downvote