Sharepoint WebApplication and Powershell – Permission Policy

…this post was published on 2015 June 21.

Let’s try to manage permission policies for a web application in SharePoint 2013. If you prefer GUI, it can be found here

By default for a WebApplication  exists 4 policies:

To manage Permission Policy for a WebApplication using PowerShell you should use .PolicyRole property.

1. Display Existing Policies

The default policies names are:

2. Add a New Policy

You will use this syntax

$web.PolicyRoles.Add(“New_Policy_Name”,”Description”)

The policy will appear in GUI as well

If you select the last one, the newest, you will see that Site Collection Permissions are in-checked

It doesn’t have Site Collection Administrator and Auditor enabled

To set them using PowerShell

And the result is perfect !

 

3. Delete an existing Policy

How to delete an existing policy, in my case the policy named : ViewItems_Policy created in step 2?

You should use $web.PolicyRoles.Delete method:

After this step, the policy was removed

To change an existing policy’s permissions read this post

This entry was posted in Powershell, Sharepoint 2013. Bookmark the permalink.