While IIS 7 comes with integrated Powershell cmdlets, the still widely used IIS 6 doesn't.
Here are some IIS 6 cmdlets to automated most of the usual tasks of setting up websites.
Name | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | ![]() |
Name of the app pool to start | MyPool |
Start-IIS6AppPool -Name "MyPool"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | ![]() |
Name of the app pool to stop | MyPool |
Stop-IIS6AppPool -Name "MyPool"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | ![]() |
Name of the app pool to create | MyPool |
Username | string | Identity of the app pool | PoolUser | |
Password | string | Corresponding password if the user is set | Password1 |
New-IIS6AppPool -Name "MyPool" -Username "Bob" -Password "Password1"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | ![]() |
Name of the app pool to delete | MyPool |
Remove-IIS6AppPool -Name "MyPool"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | ![]() |
Name of the website to start | MySite |
Start-IIS6Website -Name "MySite"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | ![]() |
Name of the website to stop | MySite |
Stop-IIS6Website -Name "MySite"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | ![]() |
Name of the website to create | MySite |
Path | string | ![]() |
Path to the website root on disk | C:\Inetpub\MySite |
AppPool | string | ![]() |
Name of the app pool that will host the website | MyPool |
Ip | string | Ip address binding | 162.10.16.4 | |
Port | integer | Port number to use | 1234 | |
HostHeader | string | Host header to use | my.website.com | |
DefaultAccess | switch | Enables anonymous access to the website | ||
DefaultDoc | string | List of default documents | Default.aspx |
New-IIS6Website -Name "MySite" -Path "C:\Inetpub\MySite" -AppPool "MyPool" -Ip "162.10.16.4" -Port 1234 -HostHeader "my.website.com" -DefaultAccess -DefaultDoc "Default.aspx"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | ![]() |
Name of the website to delete | MySite |
Remove-IIS6Website -Name "MySite"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Website | string | ![]() |
Name of the website that will contain the virtual directory | MySite |
Name | string | ![]() |
Virtual directory name | Content |
Path | string | ![]() |
Path the directory should point to | C:\Inetpub\Content |
New-IIS6VirtualDirectory -Website "MySite" -Name "Content" -Path "C:\Inetpub\Content"
Name | Type | Required | Description | Example |
---|---|---|---|---|
Website | string | ![]() |
Name of the website that contains the virtual directory | MySite |
Name | string | ![]() |
Name of the virtual directory to delete | Content |
Remove-IIS6VirtualDirectory -Website "MySite" -Name "Content"