search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Suspending IIS7 Website with Powershell
Posted in Hosting & IIS7, Windows Powershell | No Comment | 4,580 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
}

Status can be true (1) or false (0).



Leave a Reply