Microsoft Surface Hub 2 SmCamera User Manual
Page 535
![background image](/files/873833/content/doc535.png)
{
$credMsol = $credEx
}
elseif
($fSfbIsOnline)
{
$credMsol = $credSfb
}
else
{
CleanupAndFail
"Internal error - could not determine MS Online
credentials"
}
try
{
PrintAction
"Connecting to Azure Active Directory Services..."
Connect-MsolService
-Credential
$credMsol
PrintSuccess
"Connected to Azure Active Directory Services"
}
catch
{
# This really shouldn't happen unless there is a network error
CleanupAndFail
"Failed to connect to MSOnline"
}
}
PrintAction
"Importing remote sessions into the local session..."
try
{
$importEx =
Import-PSSession
$sessEx
-AllowClobber -WarningAction
SilentlyContinue
-DisableNameChecking
$importSfb =
Import-PSSession
$sessSfb
-AllowClobber -WarningAction
SilentlyContinue
-DisableNameChecking
}
catch
{
}
if
(!$importEx
-or
!$importSfb)
{
CleanupAndFail
"Import failed"
}
PrintSuccess
"Import successful"
$mailbox =
$null
try
{
$mailbox =
Get-Mailbox
-Identity
$strUpn
}
catch
{
}
if
(!$mailbox)
{