I am writing a PowerShell script to take an automated backup of the Exchange environment.
In the process of doing that i need to run “Get-ExchangeCertificate | select Thumbprint, Services, CertificateDomains” and get “certificate domains” and other fields from an Exchange 2016 Environment.
If I run this command via the “Exchange management shell” the command works fine and displays the “certificate domains”.
But If I were run PowerShell and connect to the on-premises environment (New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “http://$ExchServ/powershell” -Authentication Kerberos), run the same Get-ExchangeCertificate command as above, the “certificate domains” shows BLANK.
How can I get it to show the field with a remote session.