Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $siteUrl = <url to your sitecollection>
- $username = <username>
- $password = <password>
- add-type -Path ".Microsoft.SharePoint.Client.dll"
- add-type -Path ".Microsoft.SharePoint.Client.Runtime.dll"
- $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
- $securePassword = ConvertTo-SecureString $password -AsPlainText -Force
- $clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword)
- $site = $clientContext.Site;
- $clientContext.Load($site)
- $clientContext.executeQuery()
Add Comment
Please, Sign In to add comment