IIS Recycle Application Pool By A Non-Admin User

Environment:

  • VM “Test01” => from where we are going to use “msdeploy.exe” and recycle an ApplicationPool from “Test2”.
  • VM “Test2”.
  • Both VM’s must have Management Service role installed (Web Server (IIS) > Management Tools >Management Service).
  • Both VM’s must have Web Deploy (3.6) installed. We could go for a higher version but ensure both have the same version.
msdeploy -verb:sync -source:recycleApp -dest:recycleApp=”Site_Name”,recycleMode=”StopAppPool”,wmsvc=Server_Name,userName=<<username>>,password=<<password>> -allowuntrusted
C:\Program Files (x86)\IIS\Microsoft Web Deploy V3>msdeploy -verb:sync -source:recycleApp -dest:recycleApp=”Default Web Site”,recycleMode=”StopAppPool”,wmsvc=Test2,userName=userTest2,password=PASSWORD -allowuntrusted
Info: Using ID ‘8323fd4c-368b-4f6b-9c84–4cc3bd6a404a’ for connections to the remote server.
Info: Updating recycleApp (Default Web Site).
Total changes: 1 (0 added, 0 deleted, 1 updated, 0 parameters changed, 0 bytes copied)
msdeploy -verb:sync -source:recycleApp -dest:recycleApp="Site_Name",recycleMode="StartAppPool",wmsvc=server_Name,userName=<<username>>,password=<<password>> -allowuntrusted
C:\Program Files (x86)\IIS\Microsoft Web Deploy V3>msdeploy -verb:sync -source:recycleApp -dest:recycleApp="Default Web Site",recycleMode="StartAppPool",wmsvc=Test2,userName=userTest2,password=PASSWORD-allowuntrusted
Info: Using ID '863a1c3c-36aa-4850-ae37-8077e198a32a' for connections to the remote server.
Info: Updating recycleApp (Default Web Site).
Total changes: 1 (0 added, 0 deleted, 1 updated, 0 parameters changed, 0 bytes copied)

Resources:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store