Wednesday, June 16, 2021

some Powershell commands not all working

 Ran into a problem when running some powershell commands, these were specifically for Microsoft Teams

I kept getting errors running this command

Get-CsOnlineTelephoneNumber -TelephoneNumber 15552129191

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

Despite authenticating to 365 (via powershell)

PS C:\WINDOWS\system32> install-module microsoftteams

PS C:\WINDOWS\system32> import-module microsoftteams

PS C:\WINDOWS\system32> connect-microsoftteams

Account                            Environment Tenant                               TenantId

-------                            ----------- ------                               --------

adminuser@companyinc.onmicrosoft.com AzureCloud  27151f1b-5172-41f3-a416-21146a11d221 1715cf1b-5571-41f3-a166-21146a1fd120

PS C:\WINDOWS\system32> Get-CsOnlineTelephoneNumber -TelephoneNumber 15552129191

ERROR

My coworker told me they had same problem and had to change a registry entry

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client

DWORD "AllowBasic" = 1



Was able to run successful commands that were failing prior

No comments:

Post a Comment

Feel free to leave a comment! If you have any information that you think should be included, please do so here and I'll get it added in.