VBScript works on 1 server but failed on others 
Author Message
 VBScript works on 1 server but failed on others

Hi,

I'm writing a ASP page using VBScript to do a remote-reboot of win2k Server.
However , this script works on one of my win2k server but doesn't works on
others.

I'm getting the following error :
Error Type:
SWbemServices (0x80041001)
Generic failure
/service/RemoteReboot.asp, line 14   (the GetObject line)

Anybody know why ?

Thanks in advanced !

The code is as follow :
<html>
<head>
<title>Reboot Server</title>
<meta name="description" content="Using XML within ASP pages">
<meta name="keywords" content="XML, XML-RPC, ASP, Active Server Pages,
Internet Explorer, NT, Windows">
</head>
<body bgcolor="#FFFFFF" alink="#008000" vlink="#800080" link="#0000FF">

<%
Dim OpSysSet
Dim OpSys

Set OpSysSet =
GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}//./root/cimv
2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")

for each OpSys in OpSysSet
 OpSys.Reboot()
next
%>

</body>
</html>

Regards,
Leonard.



Tue, 08 Jul 2003 18:11:15 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. DBGrid Delete Key function not working on some DBGrids while it works on others

2. ADSI call works in vbscript fails in jscript

3. ADSI call works in vbscript fails in jscript

4. ADSI call works in vbscript fails in jscript

5. FileSystemObject: works on some machines, others not

6. !!Works on Some, not on Others!!

7. FileSystemObject: works on some machines, others not

8. vbscript runs fine from local harddrive but fails when run from IIS server

9. Procedure working on some machines and not others

10. Works on my PC, but not others????

11. Everything works in DEVELOPMENT PC and not others

12. Data Control Refresh works sometimes, others Not?!

 

 
Powered by phpBB® Forum Software