Running Get-ExchangeCertificate using a remote session.

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.

I answered a similar question on Reddit three days ago.

There is a script written that will import the full exchange environment. It will allow Get-ExchangeCertificate to return the certificate domains property remotely.

Thanks Doug. That was exactly what I needed. Worked like a charm !!!

[quote quote=260400]I answered a similar question on Reddit three days ago.

Trouble getting Exchange certificate information remotely, looking for workaround from PowerShell
There is a script written that will import the full exchange environment. It will allow Get-ExchangeCertificate to return the certificate domains property remotely.

https://gallery.technet.microsoft.com/Import-ModuleExchange-010da141

[/quote]