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

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Hosting & IIS7, Windows Powershell | No Comment | 4,345 views | 16/12/2010 21:55

Powershell function to setting connection limits for websites in IIS7.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Function Set-ConnectionLimits
{
Param ($Description, $MaxBandwidth, $MaxConnection)
 
    If ($MaxBandwidth -ne $Null)
    {
        Set-ItemProperty IIS:\Sites\$Description -Name Limits.MaxBandwidth -Value "$MaxBandwidth"
	}
 
    If ($MaxConnection -ne $Null)
    {    
        Set-ItemProperty IIS:\Sites\$Description -Name Limits.MaxConnections -Value "$MaxConnection"
    }
}

Description is the name of website in IIS7.