Microsoft Teams 访问策略 - New-CsApplicationAccessPolicy 返回 404

Hoa*_*han 9 powershell azure microsoft-teams microsoft-graph-teams microsoft-graph-api

我正在尝试使用 Microsoft Graph API 在此处创建 OnlineMeetings https://docs.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=http

但是当按照此处的说明配置应用程序访问策略时:

https://docs.microsoft.com/en-us/graph/cloud-communication-online-meeting-application-access-policy

我们收到了 404 错误:

New-CsApplicationAccessPolicy -Identity OnlineMeetings-Link -AppIds "xxx-xxx-xxx" -Description "xxxx Local"      

Get-CsOnlineSession: /Users/xxx/.local/share/powershell/Modules/MicrosoftTeams/2.3.1/netcoreapp3.1/SfBORemotePowershellModule.psm1:63

Line |
  63 |      $remoteSession = & (Get-CsOnlineSessionCommand)
     |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The remote server returned an error: (404) Not Found.

Invoke-Command: /Users/xxx/.local/share/powershell/Modules/MicrosoftTeams/2.3.1/netcoreapp3.1/SfBORemotePowershellModule.psm1:22959

 Line |
22959 |  …    -Session (Get-PSImplicitRemotingSession -CommandName 'New-CsApplic …
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | Cannot validate argument on parameter 'Session'. The argument
      | is null or empty. Provide an argument that is not null or
      | empty, and then try the command again.
Run Code Online (Sandbox Code Playgroud)

我是工作/学校帐户的管理员,我已完成所有设置先决条件:

https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-install https://docs.microsoft.com/en-us/microsoft-365/enterprise/manage-skype-for-business-online -with-microsoft-365-powershell?view=o365-worldwide

我拥有执行 PowerShell cmdlet 的所有管理员权限:

微软权限

环境:

PowerShell version: 7.1.3, installed with homebrew
MicrosoftTeams module version: 2.3.1
OS: Mac Mojave 10.14.6
Run Code Online (Sandbox Code Playgroud)

我没有防火墙,启用了 VPN/代理。当我在 VirtualBox 上的 Windows 10 VM 的默认 PowerShell 中尝试它时,会发生同样的问题。

我应该怎么做才能解决这个问题?

小智 1

从报错来看,可能有以下原因

  • App ID错误或App ID不存在
  • 会话参数为空

请您再检查一下是否有效。