2

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

Dev
  • 2,428
  • 2
  • 14
  • 15
surendra
  • 21
  • 1
  • 2
  • (1) Make sure you are part of the necessary role to perform the above operation (2) Validate the policy correctly. – Dev May 19 '21 at 15:58
  • 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 May 20 '21 at 03:12
  • @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 May 20 '21 at 18:44
  • @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 May 20 '21 at 18:46
  • The fact you're using a personal azure account seems not be the cause of the problem. I found [this issue](https://github.com/MicrosoftDocs/office-docs-powershell/issues/8021). The reporter is using a work/school account. Same error. – Fernando Costa Aug 28 '21 at 07:39

2 Answers2

1

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

Kartheek R
  • 292
  • 1
  • 4
  • I'm using Windows 10, .Net 4.8, PowerShell 7.1.4, PowerShellGet 2.2.5 and MicrosoftTeams 2.5.0, a MSA account with MFA enabled and all teams administrative roles assigned, but I'm still having the same error. Only the code line changed to 273. Connect-MicrosoftTeams with no parameters goes fine. Account name, environment, tenant and tentantId are printed. However, when I try to create an application access policy it fails showing a similar message. – Fernando Costa Aug 28 '21 at 07:25
1

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.
Dev
  • 2,428
  • 2
  • 14
  • 15
  • Thanks, but it is not working yet. I didn't mention before, but my user account has a Global Administrator role defined on Azure Active Directory. So I think permissions are good. The only thing suspicious I got during PowerShellGet module installation was this warning: The version 1.4.7 of module PackageManegement is currently in use. Retry the operation after closing the applications. As it is a warning, I don't supose it is causing this error – Fernando Costa Aug 28 '21 at 09:55
  • The above warning you're getting above reminds me [this]. Not sure you tried this earlier and helped? (https://stackoverflow.com/questions/66305351/powershell-unable-to-update-powershellget-error-the-version-1-4-7-of-modul) – Dev Aug 28 '21 at 15:08
  • Thank you. It worked with an Office 365 dev tenant account. Why it doesn't work with my personal MSA? Reference: https://learn.microsoft.com/en-us/microsoftteams/platform/get-started/prerequisites?tabs=vscode#get-a-free-teams-developer-tenant-optional – Fernando Costa Aug 31 '21 at 08:04
  • Awesome update @FernandoCosta!! Glad to hear that it worked. – Dev Aug 31 '21 at 16:54
  • Do you mean that you tried with personal account and onlinemeeting API? If yes, then API is not supported for personal MSA accounts. Check the documentation https://learn.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=http – Dev Aug 31 '21 at 16:56
  • Yeah, but I'm not sure the documentation is clear about that. It states permission type Delegated (personal Microsoft account) is not supported, but I was using permission type Application along with my MSA. – Fernando Costa Sep 01 '21 at 01:43
  • yeah, but the application permission in the documentation never specified that it will work for MSA accounts or not. If you tested earlier and it doesnt work, i then i think its may be by design and documentation needs update. – Dev Sep 01 '21 at 08:28
  • Being said that still you think this is a new feature that Microsoft needs to implement then consider filing it as an uservoice [here](https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform). – Dev Sep 01 '21 at 08:29