Reset IIS Remotely

I am going to reset IIS through a batch file. Using the iisreset utility, since the batch file will be used by other users who can enter the domain without the administrator account of the target server. How can I make a batch package script with the proper resolution? Thanks in advance!

And I also do not want to prompt the user to enter a username / password, since the batch file will be called by other programs.

+3
source share
3 answers

You can create a Windows service (for example, using WCF WCF) that executes this command. The service can then be started using credentials with administrator access.

.

+2

1: . sc.exe

sc \\webserver stop w3svc
sc \\webserver start w3svc

SC , IISRESET. , WMI ,

2: , , reset IIS.

( ) -. , . KB - .

, , . Google - WCF.

+4

"iisreset computername" will reset the IIS server if they have administrator rights to the username. Although I'm not sure how to change the user account in a batch file, this can be a security issue since batch files (as I'm sure you know) are stored in plain text.

PS. It would probably be better on ServerFault

+1
source

Source: https://habr.com/ru/post/1717788/


All Articles