Microsoft Surface Hub 2 SmCamera User Manual

Page 540

Advertising
background image

if

($fHasOnline)

{

#License validation and password expiry

$accountOnline =

Get-MsolUser

-UserPrincipalName

$strUpn

-WarningAction

SilentlyContinue

-ErrorAction

SilentlyContinue

Validate

-Test

"There is an online user account for $strUpn"

-Condition

($accountOnline -ne

$null

)

-FailureMsg

"Could not find a Microsoft Online

account for this user even though some services are online"

if

($accountOnline)

{
Validate

-Test

"The password for $strUpn will not expire"

-Condition

($accountOnline.PasswordNeverExpires -eq

$True

)

-FailureMsg

"PasswordNeverExpires - the admin will need to update the device account's
password on the Surface Hub when it expires."

if

($fIsSfbOnline

-and

!$fIsExOnline)

{
$strLicenseFailureMsg =

"Has O365 license - The devices will not

be able to use Skype for Business services."

}

elseif

($fIsExOnline

-and

!$fIsSfbOnline)

{
$strLicenseFailureMsg =

"Has O365 license - The devices will not

be able to use Exchange Online services."

}

else

{
$strLicenseFailureMsg =

"Has O365 license - The devices will not

be able to use Skype for Business or Exchange Online services."

}
Validate

-Test

"$strUpn is licensed"

-Condition

($accountOnline.IsLicensed -eq

$True

)

-FailureMsg

$strLicenseFailureMsg

Validate

-Test

"$strUpn is allowed to sign in"

-Condition

($accountOnline.BlockCredential -ne

$True

)

-FailureMsg

"BlockCredential -

This user is not allowed to sign in."

}
}

#If there is an on-prem component, we can get the authoritative AD user from
mailbox

if

($fHasOnPrem)

{
$accountOnPrem =

$null

if

($strLinkedAccount)

{
$accountOnPrem =

Get-AdUser

$strLinkedUser

-server

$strLinkedServer

-credential

$credLinkedDomain

-properties

PasswordNeverExpires

-

WarningAction

SilentlyContinue

-ErrorAction

SilentlyContinue

}

else

{

#AD User enabled validation

$accountOnPrem =

Get-AdUser

$mailbox.UserPrincipalName

-properties

Advertising