diff --git a/alias-toolkit.ps1 b/alias-toolkit.ps1 index 77c2b39..4dfc798 100644 --- a/alias-toolkit.ps1 +++ b/alias-toolkit.ps1 @@ -59,18 +59,15 @@ 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' { #Ask the user what we're looking for and we're we're going to save the .csv