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
使用http和powershell发布/风险用户/消除错误_Powershell_Microsoft Graph Api_Microsoft Graph Sdks - Fatal编程技术网

使用http和powershell发布/风险用户/消除错误

使用http和powershell发布/风险用户/消除错误,powershell,microsoft-graph-api,microsoft-graph-sdks,Powershell,Microsoft Graph Api,Microsoft Graph Sdks,尝试批量删除所有有风险的登录,这样我的安全团队就可以重新开始 应该能够使用以下powershell代码完成此操作: get-riskyUser -Top 5 -Filter "Riskstate eq 'AtRisk'" -Orderby RiskLastUpdatedDateTime | Invoke-DismissRiskyUser 但我犯了5次这样的错误: VERBOSE: Performing the operation "Invoke-DismissRiskyUser_Dismiss

尝试批量删除所有有风险的登录,这样我的安全团队就可以重新开始

应该能够使用以下powershell代码完成此操作:

get-riskyUser -Top 5 -Filter "Riskstate eq 'AtRisk'" -Orderby RiskLastUpdatedDateTime | Invoke-DismissRiskyUser
但我犯了5次这样的错误:

VERBOSE: Performing the operation "Invoke-DismissRiskyUser_Dismiss" on target "Call remote 'RiskyUsersDismiss' operation".
Invoke-DismissRiskyUser_Dismiss: You cannot perform the requested operation.
我确实使用“IdentityrskyUser.ReadWrite.All”授权了连接图的作用域,并为我的管理员帐户分配了P2许可证(我认为这是愚蠢的,因为该功能是P1功能)

此cmdlet调用以下API:

因此,我找到了邮递员,根据一个新制作的应用程序注册“IdentityrskyUser.ReadWrite.All”API,通过应用程序授权为自己获得了一个新的承载令牌,该API获得了管理员的同意,然后使用以下主体发布到API:

{
  "userIds": [
    "d9460130-07f0-43a9-9faa-df8c6635f4b7",
    "faff0a2a-143e-431d-bd44-99db3f4fc30d"
  ]
}
然后回来了:

{
  "error": {
    "code": "BadRequest",
    "message": "Invalid user ids.",
    "innerError": {
      "request-id": "a1dcf05e-bbf2-436a-9614-2a2d5b5d0fc0",
      "date": "2019-12-06T19:59:03"
    }
  }
}
我三次检查了这些ID是否有效,还尝试了属性名称中的所有小写字母


不知下一步该怎么办,有人有什么想法和/或我可以在哪里发布到github以根据代码打开罚单吗?

这里有很多问题。PowerShell代码不起作用,因为我在第一次尝试时授权了read not readwrite

但这并不是全部,接下来,API和PowerShell都返回了Azure AD中不再存在的用户的用户对象ID。这些ID永远不会通过代码或实际的Azure门户被忽略。我有一个微软的案子