Powershell 删除SharePoint文件夹中的数据时出错429
我有一个PowerShell脚本,它可以刮取许多SharePoint文件夹来创建CSV文件 在过去的几天里,我一直遇到这样的错误: 使用“0”参数调用“ExecuteQuery”时出现异常:“远程服务器返回错误:(429)。” 我认为这可能是由于微软的节流,了解了这一点,解决这一问题的最佳方法是通过使用用户代理装饰流量,我的问题是如何在我的PowerShell脚本中做到这一点 任何指导都将不胜感激,我不是PowerShell专家或程序员Powershell 删除SharePoint文件夹中的数据时出错429,powershell,sharepoint,throttling,Powershell,Sharepoint,Throttling,我有一个PowerShell脚本,它可以刮取许多SharePoint文件夹来创建CSV文件 在过去的几天里,我一直遇到这样的错误: 使用“0”参数调用“ExecuteQuery”时出现异常:“远程服务器返回错误:(429)。” 我认为这可能是由于微软的节流,了解了这一点,解决这一问题的最佳方法是通过使用用户代理装饰流量,我的问题是如何在我的PowerShell脚本中做到这一点 任何指导都将不胜感激,我不是PowerShell专家或程序员 foreach( $clientsite in $cli
foreach( $clientsite in $clientsites)
{
$url = $urlbase + $clientsite
Write-Host "Reading $url"
CSOM($Url)
$global:clientContext.ExecuteQuery()
$global:clientContext.Load($global:clientContext.Web.Lists)
$global:clientContext.ExecuteQuery()
foreach( $list in $global:clientContext.Web.Lists)
{
If($list.Title -notin $excluded)
{
#$test--
#if(!$test){exit}
$global:clientContext.Load($list.RootFolder)
$global:clientContext.ExecuteQuery()
$clientno = $list.Title.substring($list.Title.length - 6, 6)
$clientName = $list.Title
$clientLocation = $list.RootFolder.ServerRelativeUrl
#$query = [Microsoft.SharePoint.Client.CamlQuery]::createAllFoldersQuery();
#Not used as RecursiveAll too wide a scope
$query = New-Object Microsoft.SharePoint.Client.CamlQuery;
$query.ViewXml = @"