1

I am trying to setup a SharePoint Online Site Collection 100% programmatically via the CSOM in a .Net application.

I have been able to create the Site Collection itself, sub-sites and lists, but I am unable to create a new Taxonomy Group and Sets since my user is not assigned as the Term Store Administrator. If I assign myself as the Term Store Administrator through the Term Store Management Tool UI my code works exactly as I need it to.

Is there a way to assign a user as the Term Store Administrator only using the c# object model? Assume the context is running under a user that has sufficient rights to do this.

3
+50

AFAIK there is no way to assign a user as TermStore Administrator using CSOM. But one thing you could do is to create a new user (similar to service account) and make that user TermStore Administrator. Run the code to create term group under the context of that user.

using (ClientContext clientContext = new ClientContext("https://yoursite.sharepoint.com/"))
{
    SecureString passWord = new SecureString();

    foreach (char c in "yourpassword".ToCharArray()) passWord.AppendChar(c);

    clientContext.Credentials = new SharePointOnlineCredentials("loginname@yoursite.onmicrosoft.com", passWord);//Pass credentials of the new user you have created
}
  • 1
    I support that. There is no way. I even check the api myself in SharePoint and I couldn't find any sign of such a function. Better say that it's not possible even thow it's not the expected answere. – Sebastian Schütze Nov 10 '15 at 20:51
  • This doesn't really work because I'm not controlling the SharePoint instance I want to use. But since you did answer the question (even with the negative) I'll give you the bounty. – Steve Nov 11 '15 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.