Microsoft Surface Hub 2 SmCamera User Manual
Page 534
try
{
$sessEx =
$null
if
($fExIsOnline)
{
$sessEx =
New-PSSession
-ConfigurationName
microsoft.exchange
-
Credential
$credEx
-AllowRedirection -Authentication
$authType
-
ConnectionUri
"https://outlook.office365.com/powershell-liveid/"
-
WarningAction
SilentlyContinue
}
else
{
$sessEx =
New-PSSession
-ConfigurationName
microsoft.exchange
-
Credential
$credEx
-AllowRedirection -Authentication
$authType
-
ConnectionUri
https://$strExServer/powershell
-WarningAction
SilentlyContinue
}
}
catch
{
}
if
(!$sessEx)
{
CleanupAndFail
"Connecting to Exchange Powershell failed, please
validate your server is accessible and credentials are correct"
}
PrintSuccess
"Connected to Exchange Powershell Session"
PrintAction
"Connecting to Skype for Business Powershell Session..."
if
($fSfbIsOnline)
{
$sessSfb =
New-CsOnlineSession
-Credential
$credSfb
}
else
{
$sessSfb =
New-PSSession
-Credential
$credSfb
-ConnectionURI
"https://$strRegistrarPool/OcsPowershell"
-AllowRedirection -WarningAction
SilentlyContinue
}
if
(!$sessSfb)
{
CleanupAndFail
"Connecting to Skype for Business Powershell failed,
please validate your server is accessible and credentials are correct"
}
PrintSuccess
"Connected to Skype for Business Powershell"
if
($fHasOnline)
{
$credMsol =
$null
if
($fExIsOnline)