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
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