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,18 +59,15 @@ do
Set-Mailbox -Identity $Alias.Displayname -EmailAddresses $Alias.EmailAddresses.Split(";") 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. #Get the mailboxes from Exchange and print the email addresses to confirm the changes.
Foreach ($Alias in $Alias_list) { Foreach ($Alias in $Alias_list) {
$addresses = (Get-Mailbox -Identity $Alias.Displayname).EmailAddresses $addresses = (Get-Mailbox -Identity $Alias.Displayname).EmailAddresses
if ($addresses -eq $Alias.EmailAddresses) { Write-Host -Foregroundcolor Red -Backgroundcolor White (Write-Output $Alias.Displayname);
Write-Host "$($Alias.Displayname)" -NoNewline write-Host -foregroundcolor Green -Separator `n (Write-Output $addresses)
Write-Host -ForegroundColor Green " Success!" }
}
else {
Write-Host "$($Alias.Displayname)" -NoNewline
Write-Host -ForegroundColor Red " FAILURE"
}
}
} }
'3' { '3' {
#Ask the user what we're looking for and we're we're going to save the .csv #Ask the user what we're looking for and we're we're going to save the .csv