Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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