Skip to content

Commit

Permalink
Update Fix-ExOContacts.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
cosine83 authored Aug 7, 2019
1 parent 863e8b2 commit 98113f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Fix-ExOContacts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ $qUsers = Get-AdUser -Filter {Enabled -eq $true} -Properties mail

ForEach ($user in $qUsers) {
$mailAddress = $user.mail
$userName = $user.Name
Try {
Set-ADUser $user -Add @{targetAddress="SMTP:$mailAddress"}
}
Catch {
Write-Host "$mailAddress already has targetAddress set"
Write-Host "$userName already has targetAddress set"
}
}

Expand Down

0 comments on commit 98113f6

Please sign in to comment.