Mar 03 2023 08:15 AM
I'm using the following for powershell to connect to Exchange 2016 and it works most of the time but sometimes i keep on getting 401 unauthorized. I would try running it on the server itself or from one Exchange to another with same results. I wait a day, it'll start to work again. Is this a bad syntax account issue? or is there a better way?
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver1/PowerShell/ -Authentication Kerberos -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
Import-PSSession -Session $Session -DisableNameChecking -AllowClobber| out-null
Mar 03 2023 08:44 AM
Mar 03 2023 09:40 AM