Hi
I am trying to create multiple PSSession to exchange management shell. I can’t figure out how to get this done. The code below is
$ScriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$Serverlist = @(get-content -Path "$ScriptDir\serverlist.txt")
foreach ($Server in $Serverlist) {
$UserCredential = Get-Credential
$MySession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$Server.globalnet.lcl/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Import-PSSession $MySession
Get-MailboxDatabaseCopyStatus | Select-Object Name, Status, activationpreference | Format-Table -AutoSize
}
Get-PSSession | Remove-PSSession
-
This topic was modified 4 weeks, 1 day ago by
mrdon03.
-
This topic was modified 4 weeks, 1 day ago by
mrdon03.