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

Show logonserver

Status
Not open for further replies.

MEEL

Technical User
Feb 23, 2003
3
SE
Hi!
I want to remotely get the name of the logonserver for the logged on user.
The name is stored under HKCU\Volatile Environment\Logonserver and it works fine to get the value of the key on the local machine but not remote. It works fine with other registerkeys but not "Volatile Environment"

What can I do?

\Mattias

This is the code I used


const HKEY_CURRENT_USER = &H80000001
const HKEY_LOCAL_MACHINE = &H80000002


strComputer = "PC-001"
Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")


strKeyPath = "Volatile Environment"
strValueName = "LOGONSERVER"
oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
StdOut.WriteLine "Current Logonserver: " & dwValue

 
how about %logonserver% environment variable???
can get with with expandenvironmentstrings,,,or am i missing the point?

von moyla
 
Yes, this works on the local machine. But how do I get the "logonserver" for another PC.

/Mattias
 
so you want to run a script locally on your machine which connects to a users machine or should i say uses DCOM to run a command on the users machine and then display it to you?

i skipped the section in my book on wmi security!!

whats wrong with auditing this information at logon with a logon script?

or perhaps querying the DC's to find out which one has the most recent .lastlogin value.

i am sorry but at the moment i cannot answer your specific question and i am sure you have thought of the above mentioned possibilities.

best of luck
von moyla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top