Skip to content

Commit

Permalink
Fix: server parameter at Set-ADUser was missing (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhouthuijzen authored Aug 22, 2024
1 parent 8d08247 commit a529934
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (-Not($dryRun -eq $true)) {
$previousAccount = Get-ADUser -Identity $account.Identity -Properties $properties -Server $eRef.domainController.Name | Select-Object $properties

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

$success = $true
Expand Down

0 comments on commit a529934

Please sign in to comment.