我正在开发用于Microsoft Graph访问的PowerShell模块。 我整合了差异查询功能的最后几天,看起来像这样(我为了简单起见删除了其他代码行)
$Uri = "https://graph.microsoft.com/beta/users/delta"
$Headers = @{}
$Headers.Add('Authorization',$AuthToken.token_type + ' ' + $AuthToken.access_token)
$Responses = @()
while ($Uri.Length -gt 0)
{
Add-TraceLine -F_Type $MSG_INFO -F_Text "$($MyInvocation.MyCommand.Name): Calling '$($Uri)'"
$Response = Invoke-RestMethod -Method GET -Uri $Uri -Headers $Headers
$Responses += $Response
$Uri = $Response.'@odata.nextlink'
}
我的开发人员没有任何问题,但在使用一个较大的产品(大约2000个用户)进行一些“寻呼召回”后,我收到404错误。
12.01.2017-17:34:49: <INFO> - Get-AuthToken: AuthToken successfully retrieved
12.01.2017-17:34:49: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta'
12.01.2017-17:34:52: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=pqwSUjGY...LEt9NU'
12.01.2017-17:34:55: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=pqwSUjGY...-YFO04'
12.01.2017-17:34:59: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=Ea-8SYD1...utlDfs'
12.01.2017-17:35:02: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=rYOEcH4S...CyiqGw'
12.01.2017-17:35:06: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=pqwSUjGY...qCQ2Bw'
12.01.2017-17:35:10: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=pqwSUjGY...pMe6nQ'
12.01.2017-17:35:13: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=Ea-8SYD1...M1-hqA'
12.01.2017-17:35:17: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=pqwSUjGY...XpIjLQ'
12.01.2017-17:35:19: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=pqwSUjGY...rSTlUE'
12.01.2017-17:35:22: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=pqwSUjGY...XScaFk'
12.01.2017-17:35:25: <INFO> - Get-DirectoryDelta: Calling 'https://graph.microsoft.com/beta/users/delta?$skiptoken=rYOEcH4SBvAbBlMmovFlUmEWcRpD3JGmdLx1AavA9i1hdAmi16prEydV034jKvF9jlwlRi0yEQ3C3nO31HjIyDSmVYeq__2yrGCn8Hyt76YWRrLrd-Jn7yxLBkbWKnadJaoLGom5dwAq9294oQuqv4aFKDjZa_NlGyttgLLF6l6mNHXMxSBRB5QOR-zaFosyk2S-5_vAeibPer0MufNUECzL-qTxE5KGrTdjxkbg5ZdSRggf3IgclrVIii7wWDd_2MoTwy3oZtsbqoPKHR4zt6n_W95yZfgHl0sDK_ZZa-s86gJnIg7RgETBuJQrSc7OnUjn2yIoBsf-5qfXqUxGLNCm4_FJjFJsD83wdZkLvjgVe42iFj98Qf96NAkHeZ68qPcFcLn0OUZ8LW_nDQHF7h43GcHT5JHduh-84KaeUEQOglbKWCGE7e7yajoGlIW1H4zB0gQWbPrXAobunXxviZsj3ux3yl75PQR1XpM0FKG1ZRA_u3DVULsans1aoEglLGNUFE25S5Vv-rqJrcxZaEtuVbTU729rTdaH5Nvn08NseOZNvILYtCPeRSRSdwM23OJm1PPj3d_OzwmMRVsh3q5Akv43fZhgC7fDoK1mCeuAz2yYD-iIts1yxt9TpcaVPNp51h7l6b8XQlXzVek53KX7apm5PBSaPPe0Sjm9qfL-Rog6X8L2Tv59EbWcOIEGjhxk0GWqAC9QcS-RiZTRtz2iet_dW3u_1j7EO2AQ_tg8-U7rjm7qW9P_0eycpQSL7i7dKDe5344HQh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d6WwxLUvV36h5lyfqkrBKDUiYTKqXdRtRX0NXxkx4D8CNeviO4F8cKEL4U-OidM0Z55m7NYTVaAtq0hF43wz_nNPf6ywcx3gDPfhTxOXeFJ5SGGpbg4gTV3ChhehKQK9cSUGOD02u3vTU_vXim0ClrVixEqUfasAEIOlwtw90TrJoeN-ynO0MoYCDo7UfgQVqxXIvBliwMIiEQ6bHCmerZc9lU4S_e_zIs5EHKBOicnsihQtJ2cgh_iBfILPN1ULfTTbVmCygElIBVeJf1YojxRcYI3TlGNtDapt7_LyRpE-kf-gxJn96XoKXzqNu9SSbpLWO31Zu95YmiRLHtqDagAvpfjAOuu2ffweFCuA83bZKqWPw3m7aX3OmIKHqYmjqy9s--jmuez231MROGdY-NlMdnf3I1JcWaxoEbh0DdwBNtF6lM4pDewqphDWbiiLYOvIyfDRliRGZAshidZDr8IJ7yI6uKuEIGwmiVl3seJ_Emmq53TiSUm4ysY1noRM76UMYoiV7PtZNBKSjiGJWSlHpK5xGQUyfYHeQnuyUm1RBtuXrnnzSHxWDl13YHBxTXjE4L0pImKMO__by6ZD5QV31Myygz2BYikTxF5a7G70pgVuFa-Fe25yVERnxA_YvDsxBHVrGDHMSJtRbbbxfzd7xUv5L6EQRkQwoz-f4p5e4vTOogTJYBdNIuzRoJWriK5i56R8VKAVG2GrST0hgZVFQhVPr_w9TRuRgGnsza8i04F-P43kK2AlqEmz96SSioqHPCxnGFdqmnlmUZp6Do6Oa07QJxPlG8kE_VY4qryVAWe9usqTGVuCIJP5QGjf043YYMfzJb62I-rMjYth-fFfrMdzmdkrpbGCVm9JvJhB30odBh9b9ptoJgFJOqcGklwvnwxxBeZI1v_XDL_UrPR5GRlvTZYW4_BgocbQI9BKB9qTwcASY5WPYnRVZ6pSjqnJ0gmfajFOqCnsFJ6kW-oQqbupPM2VptlTHi7Un3I1g9bq-eJU1rsuHXvw22ACjP-LpaHl
我简化了所有URI,但最后2个。 你在这里看到的是,最后一个URI(失败)比其他URI长很多。 有什么想法在这里发生? 谢谢 斯蒂芬
答案 0 :(得分:0)
看起来您正在将skipToken作为deltaToken发送。您能否分享一下Client-Request-Id和Timestamp,它们可以在响应标题中找到。