Skip to content

SPWebAppPermissions

Yorick Kuijs edited this page Dec 17, 2021 · 18 revisions

SPWebAppPermissions

Parameters

Parameter Attribute DataType Description Allowed Values
WebAppUrl Key String The url of the web application
ListPermissions Write StringArray[] List permissions that need to be configured Manage Lists, Override List Behaviors, Add Items, Edit Items, Delete Items, View Items, Approve Items, Open Items, View Versions, Delete Versions, Create Alerts, View Application Pages
SitePermissions Write StringArray[] Site permissions that need to be configured Manage Permissions, View Web Analytics Data, Create Subsites, Manage Web Site, Add and Customize Pages, Apply Themes and Borders, Apply Style Sheets, Create Groups, Browse Directories, Use Self-Service Site Creation, View Pages, Enumerate Permissions, Browse User Information, Manage Alerts, Use Remote Interfaces, Use Client Integration Features, Open, Edit Personal User Information
PersonalPermissions Write StringArray[] Personal permissions that need to be configured Manage Personal Views, Add/Remove Personal Web Parts, Update Personal Web Parts
AllPermissions Write Boolean Set all permissions

Description

Type: Distributed Requires CredSSP: No

This resource is responsible for managing the user permissions for a web application. You can either specify to set all permissions or specify individual permissions per category.

More info about the permission levels:

Examples

Example 1

This example shows how to limit the available permisions within a web app

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

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPWebAppPermissions WebApplicationPermissions
        {
            WebAppUrl            = "https://intranet.sharepoint.contoso.com"
            ListPermissions      = "Manage Lists", "Override List Behaviors", "Add Items", "Edit Items", "Delete Items", "View Items", "Approve Items", "Open Items", "View Versions", "Delete Versions", "Create Alerts", "View Application Pages"
            SitePermissions      = "Manage Permissions", "View Web Analytics Data", "Create Subsites", "Manage Web Site", "Add and Customize Pages", "Apply Themes and Borders", "Apply Style Sheets", "Create Groups", "Browse Directories", "Use Self-Service Site Creation", "View Pages", "Enumerate Permissions", "Browse User Information", "Manage Alerts", "Use Remote Interfaces", "Use Client Integration Features", "Open", "Edit Personal User Information"
            PersonalPermissions  = "Manage Personal Views", "Add/Remove Personal Web Parts", "Update Personal Web Parts"
            PsDscRunAsCredential = $SetupAccount
        }
    }
}

Example 2

This example shows how to ensure all permissions are available for a web app

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

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPWebAppPermissions WebApplicationPermissions
        {
            WebAppUrl            = "https://portal.sharepoint.contoso.com"
            AllPermissions       = $true
            PsDscRunAsCredential = $SetupAccount
        }
    }
}
Clone this wiki locally