Replace verification logic with print statement

This commit is contained in:
Jeremy D. Berkleef 2021-05-05 08:51:56 -03:00
parent 9a53092bf7
commit 5a8031486b

View File

@ -59,17 +59,14 @@ do
Set-Mailbox -Identity $Alias.Displayname -EmailAddresses $Alias.EmailAddresses.Split(";")
}
#Print the new values to console for verification
Write-Host -ForegroundColor Green -BackgroundColor White "New Values:"
#Get the mailboxes from Exchange and print the email addresses to confirm the changes.
Foreach ($Alias in $Alias_list) {
$addresses = (Get-Mailbox -Identity $Alias.Displayname).EmailAddresses
if ($addresses -eq $Alias.EmailAddresses) {
Write-Host "$($Alias.Displayname)" -NoNewline
Write-Host -ForegroundColor Green " Success!"
}
else {
Write-Host "$($Alias.Displayname)" -NoNewline
Write-Host -ForegroundColor Red " FAILURE"
}
Write-Host -Foregroundcolor Red -Backgroundcolor White (Write-Output $Alias.Displayname);
write-Host -foregroundcolor Green -Separator `n (Write-Output $addresses)
}
}
'3' {