All,
I need help with a script we're embarking on to mail enable accounts via a datafeed. We will be doing this from a remote server which will have the remote connection commands like this:
$user = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
http://server1.comany.com/PowerShell/" target="_blank" rel="nofollow">
http://server1.comany.com/PowerShell/ -Authentication Kerberos
Import-PSSession $session
Get-ExecutionPolicy
Set-ExecutionPolicy unrestricted
The question is this - Is there a way to have the script make the remote connection and if it fails it will go on a try the next Exchange server?
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
http://server1.comany.com/PowerShell/" target="_blank" rel="nofollow">
http://server1.comany.com/PowerShell/ -Authentication Kerberos
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
http://server2.comany.com/PowerShell/ -Authentication Kerberos
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
http://server3.comany.com/PowerShell/ -Authentication Kerberos
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
http://server4.comany.com/PowerShell/ -Authentication Kerberos
Not sure how to have the script confim successful connection or to show a failure?
thanks,
-k