1

I need to perform a small inventory in our network. So I wrote a VBScript which I wanted to deploy with our deployment system. My problem now is: The script is executed in the context of the AD system user.

So this lines:

Set objNetwork = CreateObject("Wscript.Network")
strOutput = strOutput & ";" & objNetwork.UserName

Wont return the logged on user but the AD system user running the script.

Does anybody know a solution for this?

hardmod
  • 431
  • 1
  • 4
  • 9

1 Answers1

0

For future google users: I solved it with this little gem: http://officewarfare.net/index.php/owexec/

  • Copy the vbs file to the local hdd
  • start the script via owexec (with parameter -c localhost)

Thats it

hardmod
  • 431
  • 1
  • 4
  • 9