Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 0x80041002

Status
Not open for further replies.

artadmin

MIS
Oct 3, 2002
17
US
I just installed Windows Script Host and am running some sample scripts. I keep getting the following Error:
Error 0x80041002
Code 80041002
Source: (null)

The error always occurs here:
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate, (Backup, Security)}!\\" _
& strComputer & "\root\cimv2")

Other scripts run fine, but it seems to fail whenever it tries to "impersonate". Could someone tell me if I haven't turned something on? I want to run this script on a local computer only. I eventually need to impersonate the administrator.

Thanks
 
This happens normally if strComputer variable is not defined prior to calling the CreateObject Function.
Try putting strComputer = "." for local box, or the address of the box you want to run the script on.
 
like I said, these scripts are pretty much straight off of Microsoft's website. I did check for the strComputer="." and it was present already. I tried setting "." to "ComputerName" and that doesn't work either.
 
Hello artadmin,

What do you try to do with ?
=impersonate, (Backup, Security)

regards - tsuji
 
Upon re-reading, you said you've installed scripting host, but, wmi requires a separate installation. I think you just don't have wmi properly installed yet?

-tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top