Guest User

Untitled

a guest
Jul 17th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. $loadInfo1 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
  2. $loadInfo2 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
  3. $webUrl = Read-Host -Prompt "HTTPS URL for the SP Online 2013 site"
  4. $username = Read-Host -Prompt "Email address login"
  5. $password = Read-Host -Prompt "Password for $username" -AsSecureString
  6.  
  7.  
  8. $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
  9. $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
  10. $web = $ctx.Web
  11. $lists = $web.Lists
  12. $ctx.Load($lists)
  13. $ctx.ExecuteQuery()
  14.  
  15. $lists| select -Property Title
  16.  
  17. $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
  18. $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securedPassword)
  19.  
  20. $field = $ctx.Site.RootWeb.Fields.GetByInternalNameOrTitle($fieldTitle)
  21. $field.Description = $fieldDesc
  22. $field.UpdateAndPushChanges($True)
  23. $ctx.ExecuteQuery()
Add Comment
Please, Sign In to add comment