question

PraveenKumar34 avatar image
1 Vote"
PraveenKumar34 asked FernandoCosta-1389 edited

Microsoft Teams online meetings on behalf of guest users using Graph API changing ApplicationAccessPolicy issue

i am trying to create online meeting on behalf of user,so there is need to change accesspolicy .so ,
i had installed Install-Module MicrosoftTeams and connected to teams powershell Connect-MicrosoftTeams using admin credentials and tried to create new access policy.

 New-CsApplicationAccessPolicy -Identity <<PolicyName>> -AppIds <<AppIds>> -Description <<Description>>

it gives error like:

 Get-CsOnlineSession : Connecting to remote server api.interfaces.records.teams.microsoft.com failed with the following error message : The WinRM client cannot process the request because the
 server name cannot be resolved. For more information, see the about_Remote_Troubleshooting Help topic.
 At C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\2.3.1\net472\SfBORemotePowershellModule.psm1:63 char:22
 +     $remoteSession = & (Get-CsOnlineSessionCommand)
 +                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : NotSpecified: (:) [Get-CsOnlineSession], PSRemotingTransportException
     + FullyQualifiedErrorId : PSRemotingTransportException,Microsoft.Teams.ConfigApi.Cmdlets.GetCsOnlineSession
    
 Invoke-Command : 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.
 At C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\2.3.1\net472\SfBORemotePowershellModule.psm1:22959 char:38
 + ...    -Session (Get-PSImplicitRemotingSession -CommandName 'New-CsApplic ...
 +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : InvalidData: (:) [Invoke-Command], ParentContainsErrorRecordException
     + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand



windows-server-powershelloffice-teams-app-devmicrosoft-graph-teamworkmicrosoft-graph-calendar
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am facing a similar problem. The cmdlet Connect-MicrosoftTeams with an MFA enabled account seems to work fine. But when I try to generate te policy...

New-CsApplicationAccessPolicy -Identity Test-policy -AppIds "<my-app-id>" -Description "Test policy"

I got the following error:

Get-CsOnlineSession: C:\Users\fadc8\OneDrive\Documentos\PowerShell\Modules\MicrosoftTeams\2.5.0\netcoreapp3.1\SfBORemotePowershellModule.psm1:273
Line |
273 | $remoteSession = & (Get-CsOnlineSessionCommand)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Run Connect-MicrosoftTeams before running cmdlets.

Invoke-Command: C:\Users\fadc8\OneDrive\Documentos\PowerShell\Modules\MicrosoftTeams\2.5.0\netcoreapp3.1\SfBORemotePowershellModule.psm1:113
Line |
113 | -Session $session `
| ~~~~~~~~
| 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.


Windows 10
PowerShell 7.1.4
PowerShellGet 2.2.5
MicrosoftTeams 2.5.0



0 Votes 0 ·
Deva-MSFT avatar image
0 Votes"
Deva-MSFT answered Deva-MSFT edited

The above is not related to Microsoft Graph, rather its part of Powershell cmdlet/script that you're using and i believe its failing with WinRM. Adding Powershell team to help.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KartheekRaparthy-6860 avatar image
0 Votes"
KartheekRaparthy-6860 answered FernandoCosta-1389 edited

Please install latest PowerShell teams module it fixes the issues. Please go through the PowerShell teams module docs. https://docs.microsoft.com/en-us/MicrosoftTeams/teams-powershell-release-notes

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

inseu avatar image
0 Votes"
inseu answered

Hello @KartheekRaparthy-6860
I installed PS MicrosoftTeams version 2.3.1 but have the same issue. Any other suggestion? My account has MFA enabled.
Thanks

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AbdelRahmanAwad-8617 avatar image
0 Votes"
AbdelRahmanAwad-8617 answered FernandoCosta-1389 commented

I have the same challenge with the same error, Account I am using has MFA enabled.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@PraveenKumar34, could you please install latest preview version and check. Most of the connecting teams and auth related issues are fixed in latest preview module. This issue also will fix with latest preview. could you please check and let us know if you still see issues.

0 Votes 0 ·

I am using MicrosoftTeams module version "2.3.2-preview" and PS Version "5.1.19041.906"

I run the following commands

 Import-Module MicrosoftTeams
 Connect-MicrosoftTeams
 New-CsApplicationAccessPolicy -Identity OnlineMeetings-Link -AppIds "<APID>" -Description "Enabling creation of online teams meeting onbehalf of service accounts"

I still get the following error

 Get-CsOnlineSession : Connecting to remote server api.interfaces.records.teams.microsoft.com failed with the following
 error message : The WinRM client received an HTTP status code of 403 from the remote WS-Management service. For more
 information, see the about_Remote_Troubleshooting Help topic.
 At C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\2.3.2\net472\SfBORemotePowershellModule.psm1:63 char:22
 +     $remoteSession = & (Get-CsOnlineSessionCommand)
 +                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 Votes 2 ·

Hi @AbdelRahmanAwad-8617,
Could you please follow this and uninstall the sfbo connecter.
Migrating from Skype for Business Online Connector to the Teams PowerShell module - Microsoft Teams | Microsoft Docs And open a support case to troubleshoot further.. (this is also documented in this doc)
https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-move-from-sfbo

0 Votes 0 ·
Show more comments