hello,
why I cannot impersonate script caller on the same machine when using WMI?
is there
a method to do it?
I do this with sortcuts, but the script runs only under Network Service
account and not under the caller's account.
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
& strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("select * from Win32_ShortcutFile
where name like 'c:\\h%'")
For Each objItem in colItems
Wscript.Echo "target: " & objItem.Target
Next
:
O.