The IIS Manager application can be started with with following command:
inetmgr.exe
Optionally, the file extension can be omitted:
inetmgr
Start IIS Service
Start-Service w3svc
Stop IIS Service
Stop-Service w3svc
Restart IIS Service
Restart-Service w3svc
The following commands require the IISAdministration module to be installed. To install the module, open a new PowerShell window as Administrator and execute the following command:
Install-Module -Name 'IISAdministration'
To see the available cmdlets available with this module, enter the following command:
Get-Command -Module 'IISAdministration'
...COMING SOON...
APPCMD must be installed before it can be used. Follow the steps below to enable this feature.
optionalfeatures
[Environment]::SetEnvironmentVariable("PATH", $Env:PATH + ";C:\Windows\System32\inetsrv", [EnvironmentVariableTarget]::Machine)
List All Sites
appcmd list sites
List Stopped Sites
appcmd list sites /state:Stopped
List Site not Configured to AutoStart
appcmd list /serverAutoStart:false
List Worker Processes
appcmd list wps
List Worker Processes for Specific AppPool
appcmd list wps /apppool.name:DefaultAppPool
List Current Requests
appcmd list requests
List Current Requests for Specific AppPool
appcmd list requests /apppool.name:DefaultAppPool
Each time a configuration change is made within IIS, a backup of the configuration is saved to the following location:
%SystemDrive%\inetpub\history
Manually created backups are stored in the following location:
%SystemDrive%\inetpub\backups
Backups can be restored from either location.
The following commands can be used to create and restore backups via the APPCMD utility.
Create Backup
appcmd add backup
Create Backup with Custom Name
appcmd add backup MyBackup
List Available Backups
appcmd list backups
Restore Backup
appcmd restore backup "MyBackup"
List Sites
appcmd list sites
Show Site Information
appcmd list site "Default Web Site" /text:*
List Site Applications
appcmd list apps /site.name:"Default Web Site"
Create Site
appcmd add site /name:MyNewSite /bindings:"http/mynewsite.com:80:" /physicalPath:"C:\home\MyNewSite\"
Delete Site
appcmd delete site "MyNewSite"
Add AppPool to Site
appcmd set app "MySite/" /applicationPool:MyAppPool
List Virtual Directories
appcmd list vdirs
List Virtual Directories for Site
appcmd list vdirs /app.name:"Default Web Site/"
Create Virtual Directory
appcmd add vdir /app.name:"MySite/app1" /path:/vdir1 /physicalPath:"C:\home\vdirpath"
List AppPools
appcmd list apppools
List Started AppPools
appcmd list apppools /state:started
Show AppPool State
appcmd list apppools "MyAppPool"
List AppPool Details
appcmd list apppool "MyAppPool" /text:*
Create AppPool
appcmd add apppool /name:MyAppPool
Add Site to AppPool
appcmd set app "MySite/" /applicationPool:MyAppPool
Start AppPool
appcmd start apppool "MyAppPool"
Stop AppPool
appcmd stop apppool "MyAppPool"
Change AppPool Property
appcmd set apppool "MyAppPool" /managedRuntimeVersion:v4.0
Changes AppPool Property (Nested)
appcmd set apppool "MyAppPool" /processModel.pingingEnabled:false
List Site Configuration
appcmd list config "Default Web Site/"
List Configuration Section
appcmd list config "Default Web Site/" /section:httpErrors
Set Configuration Property
appcmd set config "Default Web Site/" /section:httpErrors /errorMode:Detailed
List Configuration Locations
appcmd search config "Default Web Site/"