Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Access SP Term Store from console app

$
0
0

I have a console app that i used to connect to SP online to get termstore data:

    

ClientContext context = new ClientContext("https://site.sharepoint.com/"; SecureString passWord = new SecureString(); foreach (char c in "xxxxxx".ToCharArray()) passWord.AppendChar(c); context.Credentials = new SharePointOnlineCredentials("username", passWord);

  TaxonomySession taxonomySession = TaxonomySession.GetTaxonomySession(context);
                context.Load(taxonomySession, ts => ts.TermStores);
                context.ExecuteQuery();

That works great and I can connect to the term store and get data no problem... now we have decided to move on prem.  I still need to connect to the term store from a console app that will run outside of the SP environment. 

I have added a user to the term store in both Central Admin and site settings.. .has full control.. 

I cannot figure out how to pass auth to SP to give me access.. .I just keep getting 401.

Any help would be appreciated.  



sayitfast



Viewing all articles
Browse latest Browse all 7589

Trending Articles