Internet Information Server (IIS) can be managed by IIS management console and also by command line interface (CLI). And, I'm big of CLI and try to achieve tasks from CLI, which I could do from UI. CLI is pretty useful when you want to do automation.
Today, I'll share how to control IIS from CLI:
- Open command prompt and Run as administrator.
- Execute below command:
cd %WINDIR%\system32\inetsrv
- List all sites:
appcmd.exe list site
Output

- Stop site:
appcmd.exe stop site "Default Web Site"
Output

- Start site:
appcmd.exe start site "Default Web Site"
Output

Similarly you can do for AppPools, e.g.
- List all app pools
appcmd.exe list apppool
Output
you can try at your machine.
- Recycle app pool
appcmd recycle apppool /appppool.name:"DefaltAppPool"
Output
you can try at your machine.
Please share your feedback.
SubashPosted Sep 15, 2016, 7:58 AM
Useful share thank you sir
Guest UserPosted Aug 20, 2014, 6:26 PM
I agree Mahesh!
Mahesh ChandPosted Aug 20, 2014, 4:51 PM
Nice. One of the most frequently used command in IIS is iisreset :)
Guest UserPosted Aug 20, 2014, 9:50 AM
welcome Ajmal!
ajmal khanPosted Aug 20, 2014, 9:41 AM
Thank for sharing
Guest UserPosted Aug 20, 2014, 8:16 AM
Thanks Ankur! Nice talking with you too on the SSO thread :)
Ankur JainPosted Aug 20, 2014, 8:15 AM
Good one!, and helpful too..thanx for sharing...