Microsoft Surface Hub 2 SmCamera User Manual
Page 532
![background image](/files/873833/content/doc532.png)
{
Write-Host
$strMsg
-foregroundcolor
"green"
}
function
PrintAction($strMsg)
{
Write-Host
$strMsg
-ForegroundColor
Cyan
}
# Cleans up and prints an error message
function
CleanupAndFail($strMsg)
{
if
($strMsg)
{
PrintError($strMsg);
}
Cleanup
exit
1
}
# Exits if there is an error set and prints the given message
function
ExitIfError($strMsg)
{
if
($Error)
{
CleanupAndFail($strMsg);
}
}
$strUpn =
Read-Host
"What is the email address of the account you wish to
validate?"
if
(!$strUpn.Contains(
'@'
))
{
CleanupAndFail
"$strUpn is not a valid email address"
}
$strExServer =
Read-Host
"What is your exchange server? (leave blank for
online tenants)"
if
($strExServer.Equals(
""
))
{
$fExIsOnline =
$true
}
else
{
$fExIsOnline =
$false
}
$credEx =
Get-Credential
-Message
"Please provide exchange user credentials"
$strRegistrarPool =
Read-Host
(
"What is the Skype for Business registrar
pool for $strUpn"
+
"? (leave blank for online tenants)"
)
$fSfbIsOnline = $strRegistrarPool.Equals(
""
)
$fHasOnPrem =
$true
if
($fSfbIsOnline
-and
$fExIsOnline)
{