surendra
surendra

Reputation: 31

Having issue with Microsoft Teams access policy - New-CsApplicationAccessPolicy

The use case i am working is create online meeting and i followed the following documentation https://learn.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://learn.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

Upvotes: 3

Views: 5014

Answers (2)

Dev
Dev

Reputation: 2464

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.

Upvotes: 1

Kartheek R
Kartheek R

Reputation: 310

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

Upvotes: 2

Related Questions