Created
January 9, 2015 12:24
-
-
Save vgrem/2d0065a6a6d4e0ba56df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var ctx = new ClientContext(webUri)) | |
{ | |
ctx.Credentials = CreateSPOCredentials(userName, password); | |
var list = ctx.Web.Lists.GetByTitle(listTitle); | |
var item = list.GetItemById(itemId); | |
KeywordsManager.SetTaxKeywordValue(item,new []{"2013","2010"}); | |
item.Update(); | |
ctx.ExecuteQuery(); | |
} | |
public static SharePointOnlineCredentials CreateSPOCredentials(string userName,string password) | |
{ | |
var securePassword = new SecureString(); | |
foreach (var ch in password) | |
{ | |
securePassword.AppendChar(ch); | |
} | |
return new SharePointOnlineCredentials(userName, securePassword); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment