The AD PowerTool (available from support) can check for uniqueness. Here is a sample script that goes int he Add-Rowing event of the GlobalScript Editor...
sub DTM_RowAdding(dtmsource As Object, args As JobEventArgs) handles DTM.RowAdding
' User-definable script goes here -----------------
Dim firstName as string = DTM.Source("fname")
Dim middleInitial as string = DTM.Source("initial")
Dim lastName as string = DTM.Source("lname")
Dim index As Integer = 1
Dim unique As Boolean = True
Dim position As Integer
ActiveDirectoryTool.ConfigureFromDestination()
'Begin constructing an alias by concatenating the first letter of the firstname with lastname
Dim uniqueAlias As String = firstName.Substring(0, 1)
& lastName
' Check if the constructed alias is unique
if(Not ActiveDirectoryTool.VerifyUniqueInDomain("mailNickname="
& uniqueAlias)) then
' If not unique, then construct an alias by concatenating the first name, a period and the lastname
uniqueAlias = firstName + "." + lastName
' Check if the constructed alias is unique
if(Not ActiveDirectoryTool.VerifyUniqueInDomain("mailNickname="
& uniqueAlias)) then
' If the alias is not unique, then construct an alias by concatenating the first name, a period, middle initial, a period and the last name
uniqueAlias = firstName + "." + middleInitial + "." + lastName
' Check if the constructed alias is unique
if(Not ActiveDirectoryTool.VerifyUniqueInDomain("mailNickname="
& uniqueAlias)) then
' Can't construct an unique alias. So, throw an exception or send an e-mail to the administrator
NotificationTool.SimpleSendHtmlNotification("raja.mani@imanami.com", _
System.String.Format("RowAdding: Cannot construct an unique alias with {0} {1} {2}", firstName, middleInitial, lastName), _
System.String.Format("RowAdding: Cannot construct an unique alias with {0} {1} {2}", firstName, middleInitial, lastName))
end if
end if
end if
if(ActiveDirectoryTool.VerifyUniqueInDomain("mailNickname="
& uniqueAlias)) then
' The alias is unique
args.StagingDestination("mailNickname") = uniqueAlias
end if