Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hiii

I am getting the following error while restarting the IIs from a batch file.

Access denied, you must be an administrator of the remote computer to use this
command. Either have your account added to the administrator local group of
the remote computer or to the domain administrator global group


(I am able to restart the IIS from the command prompt manually
by using the following command iisreset %MachineName% /stop)

Even though i have logged in as an Administrator i am receiving this error.

I made UAC to off and restarted my server,Still i am getting the same..

Any help in this regard willl be highly appreciated...!

Thanks in Avance.........:)
Posted

1 solution

As the error said, you have to be Administrator of the machine whose IIS is being reset by your command.

Also, make sure you are running your command prompt/batch file in Administrator context.

Following are the commands I use to do the job.

C#
iisreset %ComputerName% /stop
pause
iisreset %ComputerName% /start
pause
 
Share this answer
 
Comments
Seshu--The Baadshah 25-May-15 6:21am    
Thank you Abhipal Singh

i have used the same commands that what u have listed above and i logged in as an administartor only.

still getting the issue..
Abhipal Singh 25-May-15 6:47am    
Did you run your command prompt by using "Run as Administrator"?
Seshu--The Baadshah 25-May-15 8:12am    
Yes i am running as an administrator only..!
Abhipal Singh 25-May-15 11:20am    
Well, the commands I gave work fine when I use them :)
why not you just try iisreset from batch file as see what happens?(Of course do "Run as Administrator")

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900