[Nintex Workflow] Add user to Site Collection Administrator group with REST API
Helping people to automation their workplace is my passion and lucky for me I also get paid to do so !
This week I was finishing working with a partner to improve the (poor) automation steps required by Matter Center, which no-one can really complain because Microsoft made it open-source.
Matter Center documentation requires to create each client as a new site collection in PowerShell, but this is not quite possible if the users registering these new clients on a daily basis are regular Office 365 users and not SharePoint Administrators.Thanks to a few Nintex Workflows we managed to do all the configuration in the background.
Thanks to a few Nintex Workflows we managed to do all the configuration in the background.
Now this quick blog post is regarding the challenge that we had to add the user as a Site Collection Administrator of that newly created site collection.
Since there is no mention of the sort in http://bit.ly/1TUw4AY it may useful for someone, so here it is:
- Create a new Nintex workflow in an Office 365 site list.
- Download and Import the .NWP workflow file available here to replace the blank workflow
- Edit a few of the actions at the beginning of the workflow to set the variables (I never hard-code UserName and Password for instance, so you will see a few Lookup to a different list to get the value, which you can replace since they will be showing an error once imported into your list)
Note: In this workflow, the “user” I am adding to the Site Collection Administrators group is actually the “CreatedBy” of the list item, which may sound strange since the user running that workflow may be the CreatedBy. However this is NOT the case (refer to above point: we do not want all users to be SharePoint admins!), here is how you should sequence the workflow to start:
1) After the List Item is created, a first workflow (run by CreatedBy) i.e. called “Start and Call workflow 2” and in the workflow we just add a “Start Workflow”
2) then within that first workflow we just add a “Start Workflow” making sure that this action is bein executed in an “App Step” in order to use “elevated privilege”.
3) finally all the actions are happening in Workflow2 (which you imported in step 2)
Hope this helps someone.
via François on SharePoint & more http://bit.ly/1TUwgjP
French native Sharepoint Consultant living in London. A crossway between a designer, developer and system architect. Prefers stretching the limit of out-of-the-box features rather than breaking them into code. When not working with Microsoft Sharepoint François is often found on Web2.0 News sites and related social networking tools.