1. Home
  2. Knowledge Base
  3. Microsoft
  4. Solve authentication errors of a mail account via Powershell
  1. Home
  2. Knowledge Base
  3. PowerShell
  4. Solve authentication errors of a mail account via Powershell
  1. Home
  2. Knowledge Base
  3. Windows
  4. Solve authentication errors of a mail account via Powershell

Solve authentication errors of a mail account via Powershell

This is a guide on how to solve an authentication error of your mail account via Microsoft Powershell. IMPORTANT: This should only be done by experienced people with access to an admin account!

  1. Open the command prompt with the key combination “Win “+”r” and enter “Powershell” to start Microsoft Powershell.

2. the blue Powershell input window opens. Since you can only fix this error if you are connected as admin, you must enter the following command once: Start-Process powershell -Verb runAs

This opens Powershell in a new window where “Administrator: Windows PowerShell” is displayed at the top of the window name.

Now enter the following commands one after the other:

Set-ExecutionPolicy RemoteSigned winrm quickconfig winrm get winrm/config/client/auth   $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session -DisableNameChecking get-CASMailbox -Identity USEREMAILADDRESS | fl SmtpClientAuthenticationDisabled Set-CASMailbox -Identity USEREMAILADDRESS -SmtpClientAuthenticationDisabled $false Remove-PSSession $Session

Below you will find a screenshot of the Powershell with the commands

If you enter the command “$UserCredential = Get-Credential”, a small pop-up window opens. Here you have to enter the login data for your admin account in order to fix the authentication error with the subsequent commands.

Tip: If you are asking yourself whether you can also do this on your local PC, then the answer is definitely “yes”. The whole thing can be executed by any Admin PowerShell, as you connect via “-ConnectionUri https://outlook.office365.com/powershell-liveid/” and thus start a remote connection.

In the picture, the lower part of the PowerShell has been cut off, as the user data can be seen there and since the account has already been fixed, only error messages are displayed afterwards. I will spare you that at this point. After entering these commands, authentication errors should no longer occur.

Dieser Beitrag ist auch verfügbar auf: Deutsch (German)

Was this article helpful?

Related Articles

Submit a Comment

Your email address will not be published. Required fields are marked *

Published on - 27. Oct 2020
Modified on - 1. Apr 2024
Views - 30
Likes - 0

Do you need help?

Kontaktiere uns gerne :-)
Contact Support
Skip to content