Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Check PSSession Exits

$
0
0

I have the following simple New-PSSession script that I run to connect to my exchange 2010 server.

How can I setup the script to detect if the session is already active and do nothing, else open the session.

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://test.mydomain.org/PowerShell/ -Authentication Kerberos
Import-PSSession $Session -ErrorAction Stop


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>