Skip to content

SPWebApplicationExtension

dscbot edited this page Mar 17, 2023 · 14 revisions

SPWebApplicationExtension

Parameters

Parameter Attribute DataType Description Allowed Values
WebAppUrl Key String The URL of the parent web application
Name Required String The name of the web application extension
Url Required String The URL of the web application extension
Zone Key String Specifies one of the five zones with which the internal URL of this new extension is to be associated. Default, Intranet, Internet, Extranet, Custom
Port Write String The port to run the site on
HostHeader Write String The host header to use for the web app extension
CertificateThumbprint Write String Specifies the certificate thumbprint of the SSL certificate to be used. Make sure the certificate is added to Certificate Management (SPSE only)
UseServerNameIndication Write Boolean Specifies that the Secure Sockets Layer (SSL) binding of this IIS website should use Server Name Indication (SNI) (SPSE only)
AllowLegacyEncryption Write Boolean Specifies that older SSL and TLS protocol versions and cipher suites are allowed to be used with this IIS website (SPSE only and requires Windows Server 2022)
Path Write String The path on the local servers to host the IIS web site from
AllowAnonymous Write Boolean Should anonymous access be enabled for this web app extension
Ensure Write String Present if the web app should exist, absent if it should not Present, Absent

Description

Type: Distributed Requires CredSSP: No

This resource is responsible for extending an existing web application into a new zone. The resource will provision the web application extension with all of the current settings, and then ensure that it stays present and will ensure the AllowAnonymous and Authentication methods remain consistent. Please note that this currently does not support changing the claims provider on an existing claims enabled web application externsion.

Examples

Example 1

This example shows how to create a new web application extension in the local farm

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPWebApplicationExtension IntranetZone
        {
            WebAppUrl            = "http://example.contoso.local"
            Name                 = "Contoso Intranet Zone"
            AllowAnonymous       = $false
            Url                  = "http://intranet.contoso.local"
            Zone                 = "Intranet"
            HostHeader           = "intranet.contoso.local"
            Path                 = "c:\inetpub\wwwroot\wss\VirtualDirectories\intranet"
            Port                 = 80
            Ensure               = "Present"
            PsDscRunAsCredential = $SetupAccount
        }
    }
}

Example 2

This example shows how to configure SharePoint Subscription Edition Certificate Management settings for a new web application extension in the local farm

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPWebApplicationExtension IntranetZone
        {
            WebAppUrl               = "http://example.contoso.local"
            Name                    = "Contoso Intranet Zone"
            AllowAnonymous          = $false
            Url                     = "http://intranet.contoso.local"
            Zone                    = "Intranet"
            HostHeader              = "intranet.contoso.local"
            Path                    = "c:\inetpub\wwwroot\wss\VirtualDirectories\intranet"
            Port                    = 80
            AllowLegacyEncryption   = $true
            CertificateThumbprint   = '7CF9E91F141FCA1049F56AB96BE2A1D7D3F9198D'
            UseServerNameIndication = $false
            Ensure                  = "Present"
            PsDscRunAsCredential    = $SetupAccount
        }
    }
}
Clone this wiki locally