3
votes

The use case i am working is create online meeting and i followed the following documentation https://docs.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=http

As part of this, Admin needs to create application access policy and grant it to a user.https://docs.microsoft.com/en-us/graph/cloud-communication-online-meeting-application-access-policy

While executing New-CsApplicationAccessPolicy cmdlet I am having the following error.

e.g New-CsApplicationAccessPolicy -Identity Test-policy -AppIds "ddb80e06-92f3-4978-bc22-a0eee85e6a9e", -Description "description here"

ERROR

Get-CsOnlineSession: /Users/avnika/.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/avnika/.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. 2:20 this error when i execute below policy New-CsApplicationAccessPolicy -Identity Millo-Video-policy -AppIds “334941f7-50e4-4b19-9d5d-22328ad41553” -Description “video delegation policy for app”

I would appreciate if you can help me how to solve this problem.

P.s. I am using personal azure account

2
(1) Make sure you are part of the necessary role to perform the above operation (2) Validate the policy correctly. - Dev
as suggested by @Dev, could you please confirm that you have permissions to create application access policy, have you enable application level permissions. - Jagadeesh-MSFT
@Dev The user has global Administrator role and teams administrator role. Kindly let me know if this is enough to perform the above operation - surendra
@Jagadeesh-MSFT I am quite new to this area, Can you confirm how can i enable application level permission. I have assigned all administrator roles to the user. - surendra
The fact you're using a personal azure account seems not be the cause of the problem. I found this issue. The reporter is using a work/school account. Same error. - Fernando Costa

2 Answers

1
votes

This cmdlet runs using skype connecter. But now this cmdlet is added in latest powershell module. please upgrate powershell module and run the cmdlet. please go through this link

1
votes

I tried the following steps and its working:

  1. Upgrade the microsoft teams powershell module to the latest (also follow the above steps provided by Kartheek above)
  2. Connect-MicrosoftTeams #Enter global Administrator account credential and make sure that you see Admin account details in connection output.
  3. Now execute the New-CsApplicationAccessPolicy
  4. Make sure the powershell connects/works.
  5. Usually i test the above steps in test demo tenant, before doing it in prod. Test the same and confirm if you can still repro the issue.