I wanted to get a vbs script or a batch file created that would restart IIS on a remote server. I was hoping the batch or VBS script when run it will pop up with a box asking for the server name and after entering the server name it will restart IIS on that remote server
I have the following syntax below to get the pop up box but don't know how to get the rest of the vbs script to execute iisreset
'Get the servername
strServer = InputBox("Please submit the server name","IIS Restart script")
IF strServer = "" THEN
WScript.Echo "No servername was given or you clicked Cancel"
'check if the server is online
Srvpad = "\\"&strServer&"\c$\WINDOWS\system32"
SET oChksrv = CreateObject("Scripting.FileSystemObject")
IF oChksrv.FolderExists(Srvpad) = FALSE THEN
WScript.Echo "Server " & strServer & " doesn't exist or isn't online!"
Any help would be appreciated