Microsoft Surface Hub 2 SmCamera User Manual

Page 515

Advertising
background image

}
}

## Collect account data ##

$credNewAccount = (

Get-Credential

-Message

"Enter the desired UPN and

password for this new account"

)

$strUpn = $credNewAccount.UserName
$strDisplayName =

Read-Host

"Please enter the display name you would like to

use for $strUpn"

if

(!$credNewAccount

-Or

[System.String]::IsNullOrEmpty($strDisplayName)

-Or

[System.String]::IsNullOrEmpty($credNewAccount.UserName)

-Or

$credNewAccount.Password.Length -le 0)
{
CleanupAndFail

"Please enter all of the requested data to continue."

exit

1

}

## Sign in to remote powershell for exchange and lync online ##

$credExchange =

$null

$credExchange=

Get-Credential

-Message

"Enter credentials of an Exchange user

with mailbox creation rights"

if

(!$credExchange)

{
CleanupAndFail(

"Valid credentials are required to create and prepare the

account."

);

}
$strExchangeServer =

Read-Host

"Please enter the FQDN of your exchange

server (e.g. exch.contoso.com)"

# Lync info

$credLync =

Get-Credential

-Message

"Enter credentials of a Skype for

Business admin (or cancel if they are the same as Exchange)"

if

(!$credLync)

{
$credLync = $credExchange
}
$strLyncFQDN =

Read-Host

"Please enter the FQDN of your Lync server (e.g.

lync.contoso.com) or enter to use [$strExchangeServer]"

if

([System.String]::IsNullOrEmpty($strLyncFQDN))

{
$strLyncFQDN = $strExchangeServer
}

PrintAction

"Connecting to remote sessions. This can occasionally take a

while - please do not enter input..."

try

{
$sessExchange =

New-PSSession

-ConfigurationName

microsoft.exchange

-

Credential

$credExchange

-AllowRedirection -Authentication

Kerberos

-

ConnectionUri

"http://$strExchangeServer/powershell"

-WarningAction

SilentlyContinue
}
catch

Advertising