en-US/about_SPWebApplication.help.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
.NAME
    SPWebApplication

# Description
    
    This resource is responsible for creating a web application within the local
    SharePoint farm. The resource will provision the web application with all of
    the current settings, and then ensure that it stays part of the correct
    application pool beyond that (additional checking and setting of properties
    
    The default value for the Ensure parameter is Present. When not specifying this
    parameter, the web application is provisioned.
    
    Note: When using Host Header Site Collections, do not use the HostHeader
    parameter in SPWebApplication. This will set the specified host header on your
    IIS site and prevent the site from listening for the URL of the Host Header
    Site Collection.
    If you want to change the IIS website binding settings, please use the xWebsite
    resource in the xWebAdministration module.
    
.PARAMETER Name
    Key - string
    The name of the web application

.PARAMETER ApplicationPool
    Required - string
    The name of the application pool to run this site in

.PARAMETER ApplicationPoolAccount
    Required - string
    The name of the managed account to run the app pool with

.PARAMETER Url
    Required - string
    The URL of the web application

.PARAMETER AllowAnonymous
    Write - boolean
    Should anonymous access be enabled for this web app

.PARAMETER AuthenticationMethod
    Write - string
    Allowed values: NTLM, Kerberos, Claims
    What authentication mode should be used for the web app

.PARAMETER AuthenticationProvider
    Write - string
    What authentication provider should be used for the web app. This value is required when AuthenticationMethod is set to Claims

.PARAMETER DatabaseName
    Write - string
    The name of the first content database to be created with this web app

.PARAMETER DatabaseServer
    Write - string
    The name of the database server to host the default content DB

.PARAMETER HostHeader
    Write - string
    The host header to use for the web app

.PARAMETER Path
    Write - string
    The path on the local servers to host the IIS web site from

.PARAMETER Port
    Write - string
    The port to run the site on

.PARAMETER UseSSL
    Write - boolean
    Should this web app use SSL

.PARAMETER Ensure
    Write - string
    Allowed values: Present, Absent
    Present if the web app should exist, absent if it should not

.PARAMETER InstallAccount
    Write - string
    POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5


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


    Configuration Example 
    {
        param(
            [Parameter(Mandatory = $true)]
            [PSCredential]
            $SetupAccount
        )
        Import-DscResource -ModuleName SharePointDsc

        node localhost {
            SPWebApplication HostNameSiteCollectionWebApp
            {
                Name                   = "SharePoint Sites"
                ApplicationPool        = "SharePoint Sites"
                ApplicationPoolAccount = "CONTOSO\svcSPWebApp"
                AllowAnonymous         = $false
                AuthenticationMethod   = "NTLM"
                DatabaseName           = "SP_Content_01"
                DatabaseServer         = "SQL.contoso.local\SQLINSTANCE"
                Url                    = "http://example.contoso.local"
                Port                   = 80
                Ensure                 = "Present"
                PsDscRunAsCredential   = $SetupAccount
            }
        }
    }


.EXAMPLE
    This example shows how to create a new web application in the local farm using a custom claim provider.
    A SPTrustedIdentityTokenIssuer is created named Contoso, then this SPTrustedIdentityTokenIssuer is referenced
    by the SPWebApplication as the AuthenticationProvider and the AuthenticationMethod is set to "Claims" value.


    Configuration Example 
    {
        param(
            [Parameter(Mandatory = $true)]
            [PSCredential]
            $SetupAccount
        )
        Import-DscResource -ModuleName SharePointDsc

        node localhost {

          
             SPTrustedIdentityTokenIssuer SampleSPTrust
            {
                Name                         = "Contoso"
                Description                  = "Contoso"
                Realm                        = "https://sharepoint.contoso.com"
                SignInUrl                    = "https://adfs.contoso.com/adfs/ls/"
                IdentifierClaim              = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
                ClaimsMappings               = @(
                    MSFT_SPClaimTypeMapping{
                        Name = "Email"
                        IncomingClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
                    }
                    MSFT_SPClaimTypeMapping{
                        Name = "Role"
                        IncomingClaimType = "http://schemas.xmlsoap.org/ExternalSTSGroupType"
                        LocalClaimType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
                    }
                )
                SigningCertificateThumbPrint = "F3229E7CCA1DA812E29284B0ED75A9A019A83B08"
                ClaimProviderName            = "LDAPCP"
                ProviderSignOutUri           = "https://adfs.contoso.com/adfs/ls/"
                Ensure                       = "Present"
                PsDscRunAsCredential         = $SetupAccount
            }
            
            
            SPWebApplication HostNameSiteCollectionWebApp
            {
                Name                   = "SharePoint Sites"
                ApplicationPool        = "SharePoint Sites"
                ApplicationPoolAccount = "CONTOSO\svcSPWebApp"
                AllowAnonymous         = $false
                AuthenticationMethod   = "Claims"
                AuthenticationProvider = "Contoso"
                DatabaseName           = "SP_Content_01"
                DatabaseServer         = "SQL.contoso.local\SQLINSTANCE"
                Url                    = "http://example.contoso.local"
                Port                   = 80
                Ensure                 = "Present"
                PsDscRunAsCredential   = $SetupAccount
                DependsOn = "[SPTrustedIdentityTokenIssuer]SampleSPTrust"
            }
        }
    }