Win32_NetworkConnection.UserName is empty on W2K3

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

JStone

And, BTW, I discovered it works fine on 2K3SP1 when executed againt
local computer (when a connect to "localhost"), but fails to execute
properly when I connect to the SAME machine remotely.

Can you guys help me? Is it a security issue?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top