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

PraveenKumar34 131 Reputation points
2021-05-27T09:00:10.027+00:00

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
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,711 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,885 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,388 questions
{count} vote

4 answers

Sort by: Most helpful
  1. Deva-MSFT 2,256 Reputation points Microsoft Employee
    2021-05-30T17:42:34.253+00:00

    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.

    0 comments No comments

  2. Kartheek Raparthy 1 Reputation point
    2021-06-01T00:42:41.57+00:00

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

    0 comments No comments

  3. In SEU 1 Reputation point
    2021-06-02T11:29:29.81+00:00

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

    0 comments No comments

  4. Abdel-Rahman Awad 11 Reputation points
    2021-06-03T13:08:24.973+00:00

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