Share via

Error while running Shell Script

Swapnil 216 Reputation points
2022-07-29T14:13:35.63+00:00

Hi All I am trying to create a session to Power Bi Audit Log as per below blog
https://radacad.com/build-your-own-power-bi-audit-log-usage-metrics-across-the-entire-tenant

While I get below error

PS C:\WINDOWS\system32> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.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 line:1 char:12

  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
    gTransportException
  • FullyQualifiedErrorId : -2144108321,PSSessionOpenFailed

Appreciate the help here

Windows for business | Windows Server | User experience | PowerShell

2 answers

Sort by: Most helpful
  1. Swapnil 216 Reputation points
    2022-08-08T15:32:55.12+00:00

    HI
    While trying getting below error, kindly gudie
    winrm set winrm/config/client/auth '@{Basic="true"}'
    Error number: -2144108526 0x80338012
    The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".

    Was this answer helpful?

    0 comments No comments

  2. Rafael da Rocha 5,251 Reputation points
    2022-07-29T18:48:55.68+00:00

    The linked article is outdated. Most likely your tenant has Basic Authentication disabled by now.
    Try the latest version of Exchange Online PowerShell module, and use connect-exchangeonline cmdlet to start a session with modern auth.

    If you still want to try following the blog post to the letter, running the following command from a elevated powershell console should set the needed option:

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

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.