Getting 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." when trying to run a script for MS Teams

Bajracharya, Prabinesh 417 Reputation points
2022-05-25T18:50:31.82+00:00

I am trying to run a script to get the Teams meeting policy assignments for your organization by running the below script
Get-CsOnlineUser | Select-Object objectid, TeamsMeetingPolicy | Group-Object TeamsMeetingPolicy
I am getting the below error message -
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.
I have MS Team admin and global reader role and am using this account to run the script.
I have already installed and updated MS Teams module.
I am finding out that - If basic authentication is not enabled, legacy *-Cs cmdlets will not function properly. For Remote PowerShell, basic authentication is necessary. If that is the case then how can I get Teams meeting policy assignments for my organization without enabling basic authentication?

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,749 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 95,496 Reputation points MVP
    2022-05-25T20:25:20.587+00:00

    Basic authentication needs to be enabled client-side, on WinRM settings. This is a requirement/dependency for Remote PowerShell. Microsoft is working on updating all the legacy cmdlets, but until this is done, you need to have it enabled:

    winrm set winrm/config/client/auth @{Basic="true"}
    

    That said, the 4.3.0 version of the Teams module already uses the new endpoint for Get-CsOnlineUser. There are still some legacy cmdlets remaining though, so for the time being it's best to have the WinRM settings adjusted.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Limitless Technology 43,941 Reputation points
    2022-06-01T07:20:30.923+00:00

    Hello,

    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

    It seems that the you need you to complete the steps following:

    1. Firstly create a Group Policy Object that targets the workstation that you want to enable the WinRM (e.g. “Enable WinRM”)
      Then enable the “Allow remote server management through WinRM” policy setting found under Computer > Policies > Windows Components > Windows Remote Management (WinRM) > WinRM Service. From here you need to specify the IP Address ranges that the service will accept connections from, be cautious if you just add “*” in the field as this can potentially allow incoming connection form all network locations. If possible specify the exact IP ranges that you will be performing the remote management from to reduce the risk of connection coming in from any computer.

    Note: This policy is also know as “Allow automatic configuration of listeners”

    1. Next we need to enable the “Windows Remote Management (WS-Management)” Service via the Group Policy Preferences Services.
    2. And finally we need to open up the firewall rules to allow the incoming TCP connection on the Domain Network profile.
    3. Go to Computer Configurations > Policies > Security Settings > Windows Firewall and Advanced Security > Windows Firewall and Advanced Security then right click on “Inbound Rules” and click on the “New Rule…” option.
      Check the “Predefined” option and select “Windows Remote Management” from the pop-down list and Click “Next”
    4. Then uncheck the top “Public” rule to again reduce the exposure of this services to the internet and then click “Next”
    5. Then click “Finish”
      To again reduce the exposure of this service again you can double click on the new rule you just created and remove the “Private” from the network profiles that this applies.
      You have now enable WinRM on your workstations that is required to allow you run PowerShell remote commands

    --If the reply is helpful, please Upvote and Accept as answer--

    2 people found this answer helpful.