0
votes

I am trying to apply permission policy to a user via powershell but it is not working

PS C:\Users\PO30261> Grant-CsTeamsAppPermissionPolicy -PolicyName "HR App Policy" -Identity d72f6b50-ac75-470a-80b8-919ab8b3232e 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. Basic authentication is currently disabled in the client configuration. Change the client configuration and try the request again. 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:19581 char:38

  • ... -Session (Get-PSImplicitRemotingSession -CommandName 'Grant-CsTeam ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Invoke-Command], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
2

2 Answers

0
votes

Error shows that issue is not related to apply policy. Issue is with connecting to server "Basic authentication is currently disabled in the client configuration" so update module and try again. Update-Module MicrosoftTeams

0
votes

Seems like a problem with powerShell version. Look at this discussion where community are following this issue, including me:

https://techcommunity.microsoft.com/t5/teams-developer/authenticating-with-an-access-token-connect-microsoftteams/m-p/2233794