Discussion:
batch file to run "iisreset"
(too old to reply)
John Grandy
2005-05-23 23:26:44 UTC
Permalink
Hi. I would like to create a batch file that runs "iisreset" on a large
number of web-servers (all boxes are Windows 2003 Server).

I have created a domain account that is member of the local Administrators
group of each of these boxes.
Torgeir Bakken (MVP)
2005-05-24 13:47:13 UTC
Permalink
Post by John Grandy
Hi. I would like to create a batch file that runs "iisreset" on
a large number of web-servers (all boxes are Windows 2003 Server).
I have created a domain account that is member of the local
Administrators group of each of these boxes.
Hi,

iisreset.exe can take a remote computer name on the command line,
so from an computer that have IIS installed, you could try this in
a command prompt:

iisreset.exe webserver01 /STATUS

where webserver01 is the name of the remote computer.

If that works for you, you can in e.g a batch file or VBScript file
feed the iisreset.exe command with computer names from e.g. a text
file.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
John Grandy
2005-05-24 18:03:47 UTC
Permalink
Hi Torgeir, and thanks for the response.

That method generally works.

However, for one of the servers whose IIS are being restarted in batch file:

iisreset {webservername} /restart

I receive the message

"The RPC server is unavailable"

I do not receive the messages:
Attempting stop....
Internet services successfully stopped
Attemping start...
Internet serivices successfully restarted

Looking at the Services applet on the machine I am running the batch file
from, I see that the RPC service is started.

Also, going to {webservername} and running "iisreset" directly succeeds.
Post by Torgeir Bakken (MVP)
Post by John Grandy
Hi. I would like to create a batch file that runs "iisreset" on
a large number of web-servers (all boxes are Windows 2003 Server).
I have created a domain account that is member of the local
Administrators group of each of these boxes.
Hi,
iisreset.exe can take a remote computer name on the command line,
so from an computer that have IIS installed, you could try this in
iisreset.exe webserver01 /STATUS
where webserver01 is the name of the remote computer.
If that works for you, you can in e.g a batch file or VBScript file
feed the iisreset.exe command with computer names from e.g. a text
file.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
http://www.microsoft.com/technet/scriptcenter/default.mspx
Michael Harris (MVP)
2005-05-24 23:54:33 UTC
Permalink
Post by John Grandy
Hi Torgeir, and thanks for the response.
That method generally works.
iisreset {webservername} /restart
I receive the message
"The RPC server is unavailable"
Attempting stop....
Internet services successfully stopped
Attemping start...
Internet serivices successfully restarted
Looking at the Services applet on the machine I am running the batch
file from, I see that the RPC service is started.
Also, going to {webservername} and running "iisreset" directly
succeeds.
Make sure that DCOM access has not been disabled on the server...

(MMC) Component Services -> Computers -> My Computer (if run on the server)

R-click -> Properties -> Default Prioperties tab

'Enable Distributed COM on this computer' should be checked.
Post by John Grandy
Post by Torgeir Bakken (MVP)
Post by John Grandy
Hi. I would like to create a batch file that runs "iisreset" on
a large number of web-servers (all boxes are Windows 2003 Server).
I have created a domain account that is member of the local
Administrators group of each of these boxes.
Hi,
iisreset.exe can take a remote computer name on the command line,
so from an computer that have IIS installed, you could try this in
iisreset.exe webserver01 /STATUS
where webserver01 is the name of the remote computer.
If that works for you, you can in e.g a batch file or VBScript file
feed the iisreset.exe command with computer names from e.g. a text
file.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
http://www.microsoft.com/technet/scriptcenter/default.mspx
--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.
John Grandy
2005-05-25 17:22:37 UTC
Permalink
Hi Michael, and thanks for the response.

I followed your instructions and "Enable Distributed COM on this computer"
is checked on the machine having the iisreset problems.

I also followed the same instructions for the machine I am running the batch
file from, "Enable Distributed COM on this computer" is checked there as
well.

What else could be going on ?
Post by Michael Harris (MVP)
Post by John Grandy
Hi Torgeir, and thanks for the response.
That method generally works.
iisreset {webservername} /restart
I receive the message
"The RPC server is unavailable"
Attempting stop....
Internet services successfully stopped
Attemping start...
Internet serivices successfully restarted
Looking at the Services applet on the machine I am running the batch
file from, I see that the RPC service is started.
Also, going to {webservername} and running "iisreset" directly succeeds.
Make sure that DCOM access has not been disabled on the server...
(MMC) Component Services -> Computers -> My Computer (if run on the server)
R-click -> Properties -> Default Prioperties tab
'Enable Distributed COM on this computer' should be checked.
Post by John Grandy
Post by Torgeir Bakken (MVP)
Post by John Grandy
Hi. I would like to create a batch file that runs "iisreset" on
a large number of web-servers (all boxes are Windows 2003 Server).
I have created a domain account that is member of the local
Administrators group of each of these boxes.
Hi,
iisreset.exe can take a remote computer name on the command line,
so from an computer that have IIS installed, you could try this in
iisreset.exe webserver01 /STATUS
where webserver01 is the name of the remote computer.
If that works for you, you can in e.g a batch file or VBScript file
feed the iisreset.exe command with computer names from e.g. a text
file.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
http://www.microsoft.com/technet/scriptcenter/default.mspx
--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.
Michael Harris (MVP)
2005-05-26 01:16:17 UTC
Permalink
Post by John Grandy
What else could be going on ?
Time to go googlin' (similar to searchin' for a needle in a haystack)...

Google Search: "The RPC server is unavailable" site:support.microsoft.com
http://www.google.com/search?q="The%20RPC%20server%20is%20unavailable"%20site:support.microsoft.com&num=100&scoring=d

Google Search
http://groups-beta.google.com/groups?q=%22The%20RPC%20server%20is%20unavailable%22%20group:microsoft.*
--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.
David Endlich
2010-04-13 18:15:45 UTC
Permalink
This was a big help thank

--
David Endlic
-----------------------------------------------------------------------
David Endlich's Profile: http://forums.techarena.in/members/208142.ht
View this thread: http://forums.techarena.in/server-scripting/182017.ht

http://forums.techarena.i

Loading...