在Microsoft.Graph.Intune模块中使用Get-IntuneConditionalAccessSetting时出现400错误的请求

时间:2020-04-30 08:38:11

标签: microsoft-graph-api intune

看来其他用于Intune的get命令正在运行,例如合规性和配置策略,但是当我尝试使用Get-IntuneConditionalAccessSetting命令时,总是得到以下信息:

Get-IntuneConditionalAccessSetting : 400 Bad Request
{
  "error": {
    "code": "BadRequest",
    "message": "{\r\n  \"_version\": 3,\r\n  \"Message\": \"An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - 
Activity ID: 66a698b9-a2ae-4559-ad06-9a22fd2d69f7 - Url: 
https://fef.amsub0102.manage.microsoft.com/StatelessOnboardingService/deviceManagement/conditionalAccessSettings?api-version=2018-08-13\",\r\n  
\"CustomApiErrorPhrase\": \"\",\r\n  \"RetryAfter\": null,\r\n  \"ErrorSourceService\": \"\",\r\n  \"HttpHeaders\": \"{}\"\r\n}",
    "innerError": {
      "request-id": "66a698b9-a2ae-4559-ad06-9a22fd2d69f7",
      "date": "2020-04-30T08:08:24"
    }
  }
}
At C:\Data_TempFilesOnly\PowerShell\ConditionalAccess.ps1:131 char:26
+             $IntuneObj = Get-IntuneConditionalAccessSetting | ForEach ...
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ConnectionError: (@{Request=; Response=}:PSObject) [Get-DeviceManag...lAccessSettings], HttpRequestException
    + FullyQualifiedErrorId : PowerShellGraphSDK_HttpRequestError,Microsoft.Intune.PowerShellGraphSDK.PowerShellCmdlets.Get_DeviceManagement_ConditionalAccessSettings

我自己尝试过该命令,它产生了相同的错误,因此我认为它不是实际的代码,并且特定于该命令。有什么建议吗?

2 个答案:

答案 0 :(得分:0)

https://graph.microsoft.com/v1.0/deviceManagement/conditionalAccessSettings用于内部交换条件访问,因此,如果未配置内部交换,则返回错误400。

如果要查找AzureAD条件访问,请使用https://graph.microsoft.com/beta/conditionalAccess/policies

答案 1 :(得分:0)

{ “错误”:{ “ code”:“禁止”, “ message”:“ {\ r \ n \” _ version \“:3,\ r \ n \” Message \“:\”应用程序无权执行此操作。应用程序必须具有以下范围之一:DeviceManagementServiceConfiguration.Read.All,DeviceManagementServiceConfig.Read.All,DeviceManagementServiceConfiguration.ReadWrite.All,DeviceManagementServiceConfig.ReadWrite.All-操作ID(用于客户支持):00000000-0000-0000-0000-000000000000 -活动ID:afb69295-20c4-424e-b55b-15274fd6ab1a-网址:https://fef.amsub0102.manage.microsoft.com/StatelessOnboardingService/deviceManagement/conditionalAccessSettings?api-version=2018-08-13 \“,\ r \ n \” CustomApiErrorPhrase \“:\” \“,\ r \ n \” RetryAfter \“:null ,\ r \ n \“ ErrorSourceService \”:\“ \”,\ r \ n \“ HttpHeaders \”:\“ {} \” \ r \ n}“, “ innerError”:{ “ request-id”:“ afb69295-20c4-424e-b55b-15274fd6ab1a”, “ date”:“ 2020-04-30T09:29:01” } } }

如果这是一个权限问题,如何向该应用程序添加权限?