New-WebSitesSitePolicy

New-WebSitesSitePolicy

Creates a site policy.

Syntax

Parameter Set: Default
New-WebSitesSitePolicy [-PlanName] <String> [-ComputeMode] {Shared | Dedicated} [-SiteMode] <String> [-AppConcurrentRequestLimit <UInt16> ] [-ConnectionString <String> ] [-CpuLimitPercentage <Double> ] [-CpuLimitPeriod <TimeSpan> ] [-CustomDomainsEnabled] [-FailProtectionLimit <UInt32> ] [-FailProtectionPenaltyPeriod <TimeSpan> ] [-FailProtectionPeriod <TimeSpan> ] [-FastCgiProcessLimit <UInt16> ] [-HttpQueueLength <UInt16> ] [-IdleTimeout <TimeSpan> ] [-IdleTimeoutAction <String> ] [-IpBasedSslEnabled] [-MemoryLimitInMB <UInt32> ] [-MemoryLimitWorkingSetInMB <UInt32> ] [-PipelineVariable <String> ] [-SniBasedSslEnabled] [-WebSocketsEnabled] [-WorkerProcess64BitAsDefault] [-WorkerProcess64BitEnabled] [-WorkerProcessLimit <UInt16> ] [-Confirm] [-WhatIf] [ <CommonParameters>]


 

Detailed Description

The New-WebSitesSitePolicy cmdlet creates a site policy for a specified plan.

Each plan has three site policies; one for each mode. The mode of a site policy depends on the values provided for the ComputeMode and SiteMode parameters. The following table illustrates how these values influence the mode:

Mode               ComputeMode          SiteMode

--------------     --------------       --------------

Reserved           Dedicated            N/A

Basic (Shared)     Shared               Basic

Intro (Shared)     Shared               Limited

Parameters

-AppConcurrentRequestLimit<UInt16>

Specifies the maximum number of concurrent HTTP requests that a single worker process for the site can serve.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-ComputeMode<ComputeMode>

Specifies the compute mode. Valid values are:

-- Shared

-- Dedicated

The acceptable values for this parameter are:

 

Shared

 

Dedicated

 

 

 

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

-ConnectionString<String>

Specifies a connecting string to a hosting database. If this parameter is not specified, the default instance of the hosting database is used.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-CpuLimitPercentage<Double>

Specifies the CPU limit percentage for sites under this policy.

Use this parameter with the CpuLimitPeriod parameter to prevent a single worker process from consuming a large amount of CPU resources over an extended period of time. For example, if you set CpuLimitPercentage to 80 and CpuLimitPeriod to 3 minutes, then if a worker process consumes 80% or more of CPU resources over a period of 3 minutes, the worker process is penalized by throttling its CPU consumption.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-CpuLimitPeriod<TimeSpan>

Specifies the CPU limit period for sites under this policy.

Use this parameter with the CpuLimitPercentage parameter to prevent a single worker process from consuming a large amount of CPU resources over an extended period of time.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-CustomDomainsEnabled

Indicates that sites under this policy are able to use custom domain names.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-FailProtectionLimit<UInt32>

Specifies the number of times a worker process for a site under this policy is allowed to fail within the time span defined by FailProtectionPeriod before it is stopped from running again for the duration specified by FailProtectionPenaltyPeriod.

For example, if you set FailProtectionLimit to 5, FailProtectionPeriod to 2 minutes, and FailProtectionPenaltyPeriod to 10 minutes, and then a worker process fails 5 times within a period of 2 minutes or less, the cmdlet stops new processes from starting for 10 minutes.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-FailProtectionPenaltyPeriod<TimeSpan>

Specifies the amount of time during which new worker process cannot be started.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-FailProtectionPeriod<TimeSpan>

Specifies the amount of time during which a worker process failure rate is measured.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-FastCgiProcessLimit<UInt16>

Specifies the maximum number of FastCGI processes that a single worker process for a site under this policy can create.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-HttpQueueLength<UInt16>

Specifies the maximum number of HTTP requests that can be pending in the HTTP queue.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-IdleTimeout<TimeSpan>

Specifies the amount of time that a worker process of a site under this policy is allowed to remain idle before the worker process is shut down or suspended.

Use the IdleTimeoutAction parameter to determine whether the process is shut down or suspended.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-IdleTimeoutAction<String>

Specifies the action the cmdlet takes on an idle worker process. Valid values are:

-- 0 or Shutdown.

-- 1 or Suspend. This value can only be used on computers running Windows Server 2012 R2.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-IpBasedSslEnabled

Indicates that IP-based SSL is enabled.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-MemoryLimitInMB<UInt32>

Specifies the amount of memory, in megabytes, assigned to sites under this policy.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-MemoryLimitWorkingSetInMB<UInt32>

Specifies the amount of memory, in megabytes, that a working set can consume.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-PipelineVariable<String>

Specifies a variable to be used with the pipeline operator.

 

Aliases

pv

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-PlanName<String>

Specifies a name for the plan.

 

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

-SiteMode<String>

Specifies the site mode. Valid values are:

-- Basic

-- Limited

 

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

-SniBasedSslEnabled

Indicates that SNI-based SSL is enabled.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WebSocketsEnabled

Indicates that WebSockets are enabled for sites under this policy. If enabled, the tenant is able to choose to enable WebSockets at the site level.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WorkerProcess64BitAsDefault

Indicates that sites under this policy run 64-bit worker processes by default. If this parameter is specified, the tenant must explicitly change the worker processes to 32-bit.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WorkerProcess64BitEnabled

Indicates that sites under this policy can run 64-bit worker processes.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WorkerProcessLimit<UInt16>

Specifies the maximum number of worker processes that can run on a single worker for a site under this policy.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Confirm

Prompts you for confirmation before executing the command.

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

Example 1: Create a site policy

This command creates a site policy named Plan01 with Shared compute mode and Basic site mode.

PS C:\> New-WebSitesSitePolicy -PlanName "Plan01" -ComputeMode "Shared" -SiteMode "Basic"

 

Related topics

Get-WebSitesSitePolicy

Set-WebSitesSitePolicy

Remove-WebSitesSitePolicy