Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Reflection.Assembly]::LoadFrom("$scriptdirMicrosoft.SharePoint.Client.dll")
- $context = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL)
- $context.RequestTimeOut = 1000 * 60 * 10;
- $context.AuthenticationMode = [Microsoft.SharePoint.Client.ClientAuthenticationMode]::Default
- $securePassword = ConvertTo-SecureString $password -AsPlainText -Force
- $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword)
- $context.Credentials = $credentials
- $web = $context.Web
- $site = $context.Site
- $context.Load($web)
- $context.Load($site)
- $context.ExecuteQuery()
- Set-Variable -Name "clientContext" -Value $context -Scope Global
- Set-Variable -Name "rootSiteUrl" -Value $siteURL -Scope Global
- Function Get-CQList {
- $listName = "Tasks"
- $list = $clientContext.Web.Lists.GetByTitle($listName)
- $cq = new-object Microsoft.Sharepoint.Client.ChangeQuery($true,$true)
- $col = new-object Microsoft.Sharepoint.Client.ChangeCollection #returns "Constructor not found. Cannot find an appropriate constructor for type Microsoft.Sharepoint.Client.ChangeCollection"
- $col = $list.GetChanges($cq)
- $clientContext.ExecuteQuery()
- $col.AreItemsAvailable #returns false
- foreach ($item in $col) {
- # get data here from specific column name/row
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement