Enable skype for business (enablesfb.ps1), Enable skype for business – Microsoft Surface Hub 2 SmCamera User Manual

Page 541

Advertising
background image

This script will enable Skype for Business on a device account. Use it only if Skype for
Business wasn't previously enabled during account creation.

PowerShell

PasswordNeverExpires

-WarningAction

SilentlyContinue

-ErrorAction

SilentlyContinue
}
$strOnPremUpn = $accountOnPrem.UserPrincipalName
Validate

-Test

"There is a user account for $strOnPremUpn"

-Condition

($accountOnprem -ne

$null

)

-FailureMsg

"Could not find an Active Directory

account for this user"

if

($accountOnPrem)

{
Validate

-WarningOnly -Test

"The password for $strOnPremUpn will not

expire"

-Condition

($accountOnprem.PasswordNeverExpires -eq

$True

)

-

FailureMsg

"PasswordNeverExpires - the admin will need to update the device

account's password on the Surface Hub when it expires."

Validate

-Test

"$strOnPremUpn is enabled"

-Condition

$accountOnPrem.Enabled

-FailureMsg

"AccountEnabled - this device account

will not sign in"

}
}

$global:iTotalTests = ($global:iTotalFailures + $global:iTotalPasses +
$global:iTotalWarnings)

Write-Host

-NoNewline

$global:iTotalTests

"tests executed: "

Write-Host

-NoNewline -ForegroundColor

Red $Global:iTotalFailures

"failures

"

Write-Host

-NoNewline -ForegroundColor

Yellow $Global:iTotalWarnings

"warnings "

Write-Host

-ForegroundColor

Green $Global:iTotalPasses

"passes "

Cleanup

Enable Skype for Business

## This script performs only the Enable for Skype for Business step on an
account. It should only be run if this step failed in SHAccountCreate and
the other steps have been completed ##

# EnableSfb.ps1

$Error.Clear()
$ErrorActionPreference =

"Stop"

# Cleans up set state such as remote powershell sessions

function

Cleanup()

{

if

($sessCS)

Advertising