Skip to content

Commit a529934

Browse files
authored
Fix: server parameter at Set-ADUser was missing (#44)
1 parent 8d08247 commit a529934

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

postAdAction/postAdAction.create.UpdateADAccountMsExchHideFromAddressLists.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (-Not($dryRun -eq $true)) {
3131
$previousAccount = Get-ADUser -Identity $account.Identity -Properties $properties -Server $eRef.domainController.Name | Select-Object $properties
3232

3333
Write-Verbose "Updating AD account $($account.Identity). Previous msExchHideFromAddressLists: $($previousAccount.msExchHideFromAddressLists). New msExchHideFromAddressLists: '$($account.msExchHideFromAddressLists)'"
34-
$updateUser = Set-ADUser -Identity $account.Identity -Replace @{msExchHideFromAddressLists = $account.msExchHideFromAddressLists } -ErrorAction Stop
34+
$updateUser = Set-ADUser -Identity $account.Identity -Replace @{msExchHideFromAddressLists = $account.msExchHideFromAddressLists } -Server $eRef.domainController.Name -ErrorAction Stop
3535
Write-Information "Succesfully updated AD account $($account.Identity). Previous msExchHideFromAddressLists: '$($previousAccount.msExchHideFromAddressLists)'. New msExchHideFromAddressLists: '$($account.msExchHideFromAddressLists)'"
3636

3737
$success = $true

0 commit comments

Comments
 (0)