mirror of
https://github.com/MicrosoftDocs/windows-itpro-docs.git
synced 2025-06-16 19:03:46 +00:00
Merged PR 2732: Made changes to PS script per customer suggestion
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: PowerShell for Surface Hub (Surface Hub)
|
title: PowerShell for Surface Hub (Surface Hub)
|
||||||
description: PowerShell scripts to help set up and manage your Microsoft Surface Hub .
|
description: PowerShell scripts to help set up and manage your Microsoft Surface Hub.
|
||||||
ms.assetid: 3EF48F63-8E4C-4D74-ACD5-461F1C653784
|
ms.assetid: 3EF48F63-8E4C-4D74-ACD5-461F1C653784
|
||||||
keywords: PowerShell, set up Surface Hub, manage Surface Hub
|
keywords: PowerShell, set up Surface Hub, manage Surface Hub
|
||||||
ms.prod: w10
|
ms.prod: w10
|
||||||
@ -9,7 +9,7 @@ ms.sitesec: library
|
|||||||
ms.pagetype: surfacehub
|
ms.pagetype: surfacehub
|
||||||
author: jdeckerms
|
author: jdeckerms
|
||||||
ms.author: jdecker
|
ms.author: jdecker
|
||||||
ms.date: 06/19/2017
|
ms.date: 08/16/2017
|
||||||
ms.localizationpriority: medium
|
ms.localizationpriority: medium
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ PrintAction "Configuring password not to expire..."
|
|||||||
Start-Sleep -s 20
|
Start-Sleep -s 20
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Set-AdUser $mailbox.Alias -PasswordNeverExpires $true -Enabled $true
|
Set-AdUser $mailbox.UserPrincipalName -PasswordNeverExpires $true -Enabled $true
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -1243,7 +1243,7 @@ if (!$fExIsOnline)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$strAlias = $mailbox.Alias
|
$strAlias = $mailbox.UserPrincipalName
|
||||||
$strDisplayName = $mailbox.DisplayName
|
$strDisplayName = $mailbox.DisplayName
|
||||||
|
|
||||||
$strLinkedAccount = $strLinkedDomain = $strLinkedUser = $strLinkedServer = $null
|
$strLinkedAccount = $strLinkedDomain = $strLinkedUser = $strLinkedServer = $null
|
||||||
@ -1424,7 +1424,7 @@ if ($fHasOnPrem)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#AD User enabled validation
|
#AD User enabled validation
|
||||||
$accountOnPrem = Get-AdUser $strAlias -properties PasswordNeverExpires -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
|
$accountOnPrem = Get-AdUser $mailbox.UserPrincipalName -properties PasswordNeverExpires -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
$strOnPremUpn = $accountOnPrem.UserPrincipalName
|
$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"
|
Validate -Test "There is a user account for $strOnPremUpn" -Condition ($accountOnprem -ne $null) -FailureMsg "Could not find an Active Directory account for this user"
|
||||||
|
Reference in New Issue
Block a user