J
JStone
Hi,
The following script works fine on XP and non-SP1 machines, but returns
empty username on SP1:
---------------
strComputer="computername"
Set objWbem = GetObject("winmgmts:")
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set col = objWmiService.ExecQuery("Select RemotePath, UserName from
Win32_NetworkConnection")
for each conn in col
wscript.echo conn.RemotePath & ":" & vbTab & conn.UserName
next
---------------
I'm running W2K3 SE SP1.
I also tried to accomplish the same task using registry, but I noticed
that W2K3 SP1 doesn't store UserName value in registry under
HKCU\Network\DriveLetter keys. Please help, is there any other way to
do it? Maybe I need some updates installed?
Thank you.
The following script works fine on XP and non-SP1 machines, but returns
empty username on SP1:
---------------
strComputer="computername"
Set objWbem = GetObject("winmgmts:")
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set col = objWmiService.ExecQuery("Select RemotePath, UserName from
Win32_NetworkConnection")
for each conn in col
wscript.echo conn.RemotePath & ":" & vbTab & conn.UserName
next
---------------
I'm running W2K3 SE SP1.
I also tried to accomplish the same task using registry, but I noticed
that W2K3 SP1 doesn't store UserName value in registry under
HKCU\Network\DriveLetter keys. Please help, is there any other way to
do it? Maybe I need some updates installed?
Thank you.