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

How to find the current logon server? 1

Status
Not open for further replies.

EgilHansen

IS-IT--Management
Jan 3, 2006
16
0
0
Hello

I need to know the server name of the server from where my logon server is running. How do I do that. I have managed to find the directory from where the logon script is running:

Code:
strCurrentDirectory = Left(Wscript.scriptfullname,Instr(1,WScript.ScriptFullName,wscript.scriptname,1)-1)

... but isn't there a easier way of getting the logon servers name, then to parse that string for the logon server?

Best regards, Egil.
 
A starting point:
Set myEnv = CreateObject("WScript.Shell").Environment("PROCESS")
MsgBox myEnv("LOGONSERVER")


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top