Actually, we were thinking that this was going to be more difficult than it actually is. Adding the proxyAddress attribute to the form is doing what we need. Adaxes handles this attribute very nicely in the modification view and will make it very easy for the Help Desk. Could we please get help with expanding on our script that verifies that we are using a unique email address. We are going to need to have it check all the aliases stored in the proxyAddress attribute. Only the email addresses will be stored in this attribute, there will be no smtp: prefix that is used by Exchange.
if ($Context.IsPropertyModified("mail"))
{
# Get Email address
$mail = $Context.GetModifiedPropertyValue("mail");
# Check whether the email address is empty
if ([System.String]::IsNullOrEmpty($mail))
{
return
}
# Search all users
$searcher = New-Object "Softerra.Adaxes.Adsi.Search.DirectorySearcher" $NULL, $False
$searcher.SearchParameters.PageSize = 500
$searcher.SearchParameters.SearchScope = "ADS_SCOPE_SUBTREE"
$searcher.SearchParameters.Filter = "(&(objectCategory=user)(mail=$mail))"
$searcher.VirtualRoot = $True
$result = $searcher.ExecuteSearch()
$users = $result.FetchAll()
$result.Dispose()
# Check if the Email address is unique
if($users.Count -ne 0)
{
$Context.Cancel("Email address is already in use. Please verify that account is not being duplicated");
}
}
We will also need to check that the Help Desk did not set the user object with the same email address twice, once in the mail attribute and again in the proxyAddress.