title: Remotely access certificate store using Powershell
body: <p>I have the following script which brings back any certificates on the local machine needed for our VPN client and shows the expiry date:</p>
  
  <pre><code>$asset = $env:COMPUTERNAME
  
  Set-Location cert:\LocalMachine\My
  
  Write-Host = "Asset ID:"$asset
  
  Get-ChildItem -Recurse cert: | select subject, notafter
  
  write-host "`n"
  
  Read-Host "Press any key to exit..."
  
  (Get-Host).SetShouldExit(0)
  </code></pre>
  
  <p>It runs perfectly on my local machine, bring back the following:</p>
  
  <pre><code>Subject                                              NotAfter                                            
  -------                                              --------                                            
  CN=HW008551D.hca.local                               21/07/2018 09:46:08                                
  </code></pre>
  
  <p>Is there a way I can run this on a remote machine, which looks at that machines certificate store rather than the local machines?</p>
  
  <p>I have tried a few different methods but unable to find anything that works</p>