SharePoint 2010 - Automate Site & Group Creation with Nintex Workflow 2010
What
Nintex Workflow has an action to create a site automatically in SharePoint, but it's functionality is quite limited. You can't create groups and you can't add staff to those groups. This tutorial shows you how to create a Nintex workflow to automate the whole process using SharePoint Web Services.
Why
As most SharePoint administrators are aware, it's ALWAYS a bad idea to give staff the ability to create SharePoint sites. They will end up creating them for the wrong purposes, will not maintain them, no retention policies will get assigned to them, etc.
However, you don't want to restrict your users creative freedom. You want to govern it in a manageable way.
In order to keep track of all your SharePoint sites, we need to ensure that when we allow staff to create sites/content, it is being properly tagged with the right information. As long as you are logging & tagging sites with extra data, you can easily govern and manage those sites far into the future.
This tutorial isn't simply how to automate a process that SharePoint already does. It's automating that process while enforcing that users tag their sites with data that help you manage SharePoint easier.
We are going to use the example of Project Sites. Project sites have a known lifespan, usually between 1 month & 2 years depending on size. We want to capture that information so the sites don't hang around for too long.
How
There are 6 steps in my workflow, they are:
First: Create a custom list with the following columns (depending on your needs):
1. Set Variables
I also created Workflow Variables for my Group Names that had the following naming conventions: {Project Name} - [AccessType]
2. Create Site
Use the following Nintex Action to create a site and add all the data you will collect from your list: Insert Action > Provisioning > Create Site
3. Create Group
Use the following Nintex Action to query a Web Service: Insert Actoin > Integration > Call Web Service
The image below describes what you need to input into each field to successfully run the AddGroup Web Method within the UserGroup.asmx Web Service.
This will create a group on your Site Collection without access to anything.
4. Add Group to Site
the hard part...
Now we need to give the group access to your newly created site. Create another Call Web Service Action.
The picture will explain most things, however, to get the PermissionMask value (a value assigned to a permission level like Contribute,Read Only, etc), you need to run the following Powershell script on your server: Retrieve the Permission Mask Values for a Site using Powershell
Once you have that, insert the following information to add the group to your newly created site:
5. Add Members to Group
You don't need to do this, but if you're feeling keen you can also run a web service to add a user to the newly created group like this:
6. Send Emails
Of course now you want to send a nice customised email to your user with all the information they need!
Thoughts?
This saves our team so much time, while allowing us to govern site creation and ensure that all sites have metadata tagged against them !
Have you got any cool tricks to help automate governance that you'd like to share?
If you liked this post:
Credit where it's due
Nintex Workflow has an action to create a site automatically in SharePoint, but it's functionality is quite limited. You can't create groups and you can't add staff to those groups. This tutorial shows you how to create a Nintex workflow to automate the whole process using SharePoint Web Services.
Why
As most SharePoint administrators are aware, it's ALWAYS a bad idea to give staff the ability to create SharePoint sites. They will end up creating them for the wrong purposes, will not maintain them, no retention policies will get assigned to them, etc.
However, you don't want to restrict your users creative freedom. You want to govern it in a manageable way.
In order to keep track of all your SharePoint sites, we need to ensure that when we allow staff to create sites/content, it is being properly tagged with the right information. As long as you are logging & tagging sites with extra data, you can easily govern and manage those sites far into the future.
This tutorial isn't simply how to automate a process that SharePoint already does. It's automating that process while enforcing that users tag their sites with data that help you manage SharePoint easier.
We are going to use the example of Project Sites. Project sites have a known lifespan, usually between 1 month & 2 years depending on size. We want to capture that information so the sites don't hang around for too long.
How
There are 6 steps in my workflow, they are:
- 1. Set Variables
- 2. Create Site
- 3. Create Group
- 4. Add Group to Site
- 5. Add Members to Group
- 6. Send Emails
First: Create a custom list with the following columns (depending on your needs):
- Project Name
- Project Description
- Department
- Project Sponsor
- Project Manager
- Project #
- Estimated Completion Date
1. Set Variables
I also created Workflow Variables for my Group Names that had the following naming conventions: {Project Name} - [AccessType]
2. Create Site
Use the following Nintex Action to create a site and add all the data you will collect from your list: Insert Action > Provisioning > Create Site
3. Create Group
Use the following Nintex Action to query a Web Service: Insert Actoin > Integration > Call Web Service
The image below describes what you need to input into each field to successfully run the AddGroup Web Method within the UserGroup.asmx Web Service.
This will create a group on your Site Collection without access to anything.
4. Add Group to Site
the hard part...
Now we need to give the group access to your newly created site. Create another Call Web Service Action.
The picture will explain most things, however, to get the PermissionMask value (a value assigned to a permission level like Contribute,Read Only, etc), you need to run the following Powershell script on your server: Retrieve the Permission Mask Values for a Site using Powershell
Once you have that, insert the following information to add the group to your newly created site:
Running the AddPermissions Web Method through the Permissions.asmx web service
5. Add Members to Group
You don't need to do this, but if you're feeling keen you can also run a web service to add a user to the newly created group like this:
running the AddUserToGroup Web Method through the UserGroup.asmx Web Service
6. Send Emails
Of course now you want to send a nice customised email to your user with all the information they need!
Thoughts?
This saves our team so much time, while allowing us to govern site creation and ensure that all sites have metadata tagged against them !
Have you got any cool tricks to help automate governance that you'd like to share?
If you liked this post:
Credit where it's due
- https://spnectar.wordpress.com/2010/03/02/adding-spgroups-via-sharepoint-web-services/
- http://www.sharepoint-insight.com/2011/10/23/list-of-sharepoint-base-permissions-with-their-hex-and-decimal-values/
- http://www.c-sharpcorner.com/blogs/get-site-permissions-using-sharepoint-2010-web-service-in-powershell
Comments
Post a Comment