This script works fantastically, thank you!
One issue we have found recently is that occasionally a modification to an account's FirstName does not result in a change in the Alias due to the way we construct our aliases. For example, the alias for Joe Smith would be SmithJ in our company. If the change being made was for the first name as in "Joseph" instead of "Joe" then the alias would remain "SmithJ".
We've found that the script to check for Exchange Alias uniqueness executes in this scenario, locates the account's own "SmithJ" alias, identifies it as a duplicate and creates a new one for "SmithJ2".
I have been attempting to add in an IF statement to first evaluate if there is a difference between the modified "mailNickname" and the existing %mailNickname% before running the isExchangeAliasUnique function. The following code does not work properly as the two variables are always the same...
If ($exchangeAlias -ne "%mailNickname%")
Any help would be appreciated, thank you!
<EDITED for clarity>