Restarting IIS 
Author Message
 Restarting IIS

Any service can be manipulated with the WMI, if installed:
http://www.*-*-*.com/

Consider this script, to reboot the macnine ( remove the file: from the /root./cimv2)

----RebootIt.VBS---
Set OpSysSet = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}" & _
                         "file://./root/cimv2").ExecQuery("SELECT * FROM " & _
                         "Win32_OperatingSystem WHERE Primary=true")
ianswer = MsgBox("Reboot Windows?", _
                  vbYesNoCancel, "Reboot")
If ianswer = vbYes Then 'If Yes force reboot
   For Each OpSys In OpSysSet
      outParam =  OpSys.Win32Shutdown(2)
   Next
   If err.number <> 0 Then
      WScript.echo  "Error number: " & Err.Number & _  
              vbNewLine & "Description: " & Err.Description, vbCritical
   End If
Else                   ' user selected cancel
   WScript.echo  "Operation canceled"
End If

--end file---also attached--

--
Mark L. Ferguson       Please reply in Newsgroup
marfers notes for OE 5.0  >   http://www.*-*-*.com/

Quote:

> Is it possible to stop and then restart IIS from a script using WSH?

  Reboot.vbs
< 1K Download


Sun, 29 Sep 2002 03:00:00 GMT  
 Restarting IIS
Is it possible to stop and then restart IIS from a script using WSH?


Mon, 30 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. restart IIS and MTS from a script.

2. Restarting IIS from within a .vbs

3. IIS Restart...

4. Importing server certifcates from IIS 4 to IIS 5 by using some scritps or tool

5. Restart computer by vbs ?

6. Application.Restart possible?

7. Stopping/restarting sevices

8. Shutdown and restart windows

9. Can I vbscript a system shutdown/restart?

10. Code: Force Restart Remote computers

11. Unconditional Restart

12. Restarting Applications

 

 
Powered by phpBB® Forum Software