PowerShell function to verify email addresses in Exchange environment
PowerShell function is inteded to verifying the correcteness of email address in MS Exchange env. and can be used to verifying it before adding it as the next.

Function which can be used to verifying an email address before for example adding it to Microsoft Exchange environment as next email/proxy address.

Checks performed
  • if an email address contain unsported characters e.g. % or spaces
  • if an email address is from domain which in accepted domain list
  • if an email address is currently assinged/used to/by any objcet in Exchange environment
  • if an email address contains white chars e.g. spaces or tabs at the begining or at the end



Results

As the result returned is PowerShell object which contain: EmailAddress, ExitCode, ExitDescription, ConflictedObjectAlias, ConflictedObjectType.

Exit codes and descriptions

0 - No Error
1 - Email doesn't contain 'at' char
2 - Email exist now
3 - Unsupported chars found
4 - Not accepted domain
5 - White chars e.g. spaces found before/after email

The main repository for this function is hosted on GitHub
https://github.com/it-praktyk/Test-EmailAddress

Last edited Mar 11, 2015 at 8:22 AM by wojteksci, version 3