//
home

Latest Post

[Nintex Workflow] Add user to Site Collection Administrator group with REST API

Helping people to automate 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.
Today’s post is not about the site collection creation so I will spare the details, but in summary and very high level, I developed 4 workflows, 1 CSOM Javascript to be executed on the browser, and 1 Nintex Form of course for submitting the new client on desktop or mobile.

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 https://community.nintex.com it may useful for someone, so here it is:

  1. Create a new Nintex workflow in an Office 365 site list.
  2. Download and Import the .NWP workflow file available here to replace the blank workflow
  3. 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”.

Nintex_Workflow_for_Office_365

3) finally all the actions are happening in Workflow2 (which you imported in step 2)

 

Hope this helps someone.

François.

  • This week I am off to Paris with my little family, and on Saturday I will enjoy spending my day with the French SharePoint community and presenting my views and case study of using OneDrive for Business in Office365. I will be presenting [en Français] which I have not done for years, so be sure to hear some weird "fran-glais" as the technical terms are all in english for me. The title was actually "Shall we forget about taxonomy with Office 365?" which refers to the fact that OneDrive for Business allows users to store a crazy-full amount of files on the cloud and the question that stands: what to do with all this ? What about my team sites, department sites, organised libraries with metadata that I have been telling and training my users to maintain for years ? Do I have to forget everything I learnt ? See you on Saturday to see how some of my clients are managing this question! À Samedi pour voir comment certain de mes clients gèrent cette problématique d'entreprise! 

Enter your email address to follow this blog and receive notifications of new posts by email.

My twitter update

Archives

Follow

Get every new post delivered to your Inbox.

Join 497 other followers

%d bloggers like this: