Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 删除SharePoint文件夹中的数据时出错429_Powershell_Sharepoint_Throttling - Fatal编程技术网

Powershell 删除SharePoint文件夹中的数据时出错429

Powershell 删除SharePoint文件夹中的数据时出错429,powershell,sharepoint,throttling,Powershell,Sharepoint,Throttling,我有一个PowerShell脚本,它可以刮取许多SharePoint文件夹来创建CSV文件 在过去的几天里,我一直遇到这样的错误: 使用“0”参数调用“ExecuteQuery”时出现异常:“远程服务器返回错误:(429)。” 我认为这可能是由于微软的节流,了解了这一点,解决这一问题的最佳方法是通过使用用户代理装饰流量,我的问题是如何在我的PowerShell脚本中做到这一点 任何指导都将不胜感激,我不是PowerShell专家或程序员 foreach( $clientsite in $cli

我有一个PowerShell脚本,它可以刮取许多SharePoint文件夹来创建CSV文件

在过去的几天里,我一直遇到这样的错误:

使用“0”参数调用“ExecuteQuery”时出现异常:“远程服务器返回错误:(429)。”

我认为这可能是由于微软的节流,了解了这一点,解决这一问题的最佳方法是通过使用用户代理装饰流量,我的问题是如何在我的PowerShell脚本中做到这一点

任何指导都将不胜感激,我不是PowerShell专家或程序员

 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 = @"