I have a VBS file that is failing on this line:

Set objWMIService = GetObject("WinMgmts:{authenticationLevel=pktPrivacy}
\\myserver\root\MicrosoftIISv2")

with this error:

Microsoft VBScript runtime error: The remote server machine does not
exist or is unavailable: 'GetObject'

where myserver is a Windows 2008 SP2 server. I made sure WMI is running on the server.

What could be wrong?

link|improve this question

45% accept rate
feedback

1 Answer

Can you prepend the code with On Error Resume Next and append WScript.Echo Err & " : " & Err.Description

Try the code remotely.

Then, try the code locally on the server with myserver substituted with . - i.e.: local machine. Run the code with and without local admin privs...

link|improve this answer
462 : The remote server machine does not exist or is unavailable – JoelFan Nov 19 '10 at 20:06
When I run it locally with "." there is no error on that statement, but the next statment: objWMIService.Get("IIsApplicationPool.Name=myPool") gives me "SWbemServicesEx: Provider load failure" – JoelFan Nov 19 '10 at 20:14
Have a nose at <msdn.microsoft.com/en-us/library/bb961987.aspx>; – Simon Catlin Nov 19 '10 at 20:55
( Fixed link: msdn.microsoft.com/en-us/library/bb961987.aspx ) – JoelFan Nov 19 '10 at 21:31
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.