# Running Get-ExchangeCertificate using a remote session.

**URL:** <https://forums.powershell.org/t/running-get-exchangecertificate-using-a-remote-session/15035>\
**Category:** PowerShell Help\
**Created:** [October 1, 2020, 10:21am UTC](https://forums.powershell.org/t/running-get-exchangecertificate-using-a-remote-session/15035 "2020-10-01T10:21:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdsouza](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hdsouza](https://forums.powershell.org/u/hdsouza)\
**Post date:** [October 1, 2020, 10:21am UTC](https://forums.powershell.org/t/running-get-exchangecertificate-using-a-remote-session/15035/1 "2020-10-01T10:21:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)\
**Post date:** [October 1, 2020, 11:51am UTC](https://forums.powershell.org/t/running-get-exchangecertificate-using-a-remote-session/15035/2 "2020-10-01T11:51:36Z")

</div>

I answered a similar question on Reddit three days ago.

> **[r/PowerShell - Trouble getting Exchange certificate information remotely,...](https://www.reddit.com/r/PowerShell/comments/j1bgcq/trouble_getting_exchange_certificate_information/)**
>
> 11 votes and 4 comments so far on Reddit

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

> **[Browse code samples](https://docs.microsoft.com/en-us/samples/browse/?redirectedfrom=TechNet-Gallery)**
>
> Get started with Microsoft developer tools and technologies. Explore our samples and discover the things you can build.

---

<div class="post-metadata">

**Author:** ![hdsouza](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hdsouza](https://forums.powershell.org/u/hdsouza)\
**Post date:** [October 1, 2020, 2:52pm UTC](https://forums.powershell.org/t/running-get-exchangecertificate-using-a-remote-session/15035/3 "2020-10-01T14:52:11Z")

</div>

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](https://www.reddit.com/r/PowerShell/comments/j1bgcq/trouble_getting_exchange_certificate_information/?ref_source=embed&ref=share) from [PowerShell](https://www.reddit.com/r/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](https://gallery.technet.microsoft.com/Import-ModuleExchange-010da141)

[/quote]

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:28pm UTC](https://forums.powershell.org/t/running-get-exchangecertificate-using-a-remote-session/15035/4 "2024-05-16T20:28:48Z")

</div>


