9

I would like to write a script and run it from my local PC to stop and start an application pool and site that exists on a server.

Value of App Pool and Site - Test Value of server - SERVER1

Any guidance would be much appreciated.

Rick
  • 335
  • 2
  • 4
  • 11

1 Answers1

15

Run Command Prompt with Administrative rights, and type the following:

C:\Windows\System32\inetsrv\appcmd start apppool /apppool.name:"MYAPPPOOLNAME"

or use the stop command. You could save this in a batch file, but it must be executed with higher privileges.

For the application pool on a remote server, you could use PsExec:

Psexec \\{Computer Name of ISS7 Server} C:\Windows\System32\inetsrv\appcmd recycle apppool my-app-pool
Community
  • 1
  • 1
Daniel Minnaar
  • 5,865
  • 5
  • 31
  • 52
  • Thanks for replying. Maybe I should have been clearer. The command is fine locally or on the server, but I want to run the command from my PC, therefore the command needs to mention the server name. – Rick Jul 27 '16 at 08:29