Posted in
Hosting & IIS7,
Windows Powershell |
No Comment | 4,581 views | 16/12/2010 22:24
Powershell function to suspend a IIS7 website.
1
2
3
4
5
6
| Function Suspend-WebSite
{
Param ($Description, $Status, $Redirect)
Set-WebConfiguration -Filter /System.WebServer/HttpRedirect -value (@{Enabled="$Status"; Destination="$Redirect"}) -PSPath IIS:\ -Location $Description
} |
Function Suspend-WebSite
{
Param ($Description, $Status, $Redirect)
Set-WebConfiguration -Filter /System.WebServer/HttpRedirect -value (@{Enabled="$Status"; Destination="$Redirect"}) -PSPath IIS:\ -Location $Description
}
Status can be true (1) or false (0).