Add policies to personal or community libraries

If the previous script is used to add a new policy and would like to add it to the personal and community libraries the UUID from Policy and Community is required.

Using the FilesLibraryService can be tricky, a lot of information is returned and it can be difficult to find the IDs required.

bild41

Once you have the IDs required the assignPolicy wasadmin command can be used to assign the policy.
Example assign Policy (string libraryId, string policyId)

FilesLibraryService.assignPolicy("f0d01111-9b21-4dd8-b8be-8825631cb84b","2d93497d-065a-4022ae25-a4b52598d11a")

The cnxLibraryPolicies.py can be used to easily facilitate this.

This script is still a POC but is very affective. The scripts lists all of the Communities and Policies
In the example below – the test environment has 19 libraries (a mixture of personal and community)

bild42

The script prompts for the library that you wish to assign the new policy to, and the policy that you wish to assign – it’s as simple as that.

In the example policy 5 2GB has been assigned to personal libraries 0 & 1

bild43