Guest User

Untitled

a guest
Jan 4th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. $siteUrl = <url to your sitecollection>
  2. $username = <username>
  3. $password = <password>
  4. add-type -Path ".Microsoft.SharePoint.Client.dll"
  5. add-type -Path ".Microsoft.SharePoint.Client.Runtime.dll"
  6. $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
  7. $securePassword = ConvertTo-SecureString $password -AsPlainText -Force
  8. $clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword)
  9. $site = $clientContext.Site;
  10. $clientContext.Load($site)
  11. $clientContext.executeQuery()
Add Comment
Please, Sign In to add comment