Lo_Result = GetPowerShellResult(PS = R"( try { $mailSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:/)" + R"(/server.xyz.ch/PowerShell/set} catch {} try { Import-PsSession $mailSession } catch {} try {$Mail = Get-MailContact -Identity )" + Lo_Address.s_EmailB + R"( } catch {} if (-not $Mail) { try {$Mail = Get-MailBox -Identity )" + Lo_Address.s_EmailB + R"( } catch {} } Get-Variable Mail)"); |
---|