Hello Adam,
You can check whether the username is unique using a PowerShell script. If it is not unique, you can, for example, automatically add a digit to the end of the username. To learn how to do that, refer to the following tutorial: http://www.adaxes.com/tutorials_Simplif ... Script.htm. On Step 5, see Example 2.
If you prefer cancelling creation of a new user instead of adding a digit, that can also be done. For this purpose, use the following version of the script:
Import-Module Adaxes
$username = $Context.GetModifiedPropertyValue("samAccountName")
function IsUserNameUnique($username)
{
$user = Get-AdmUser $username -erroraction silentlycontinue
return $user -eq $Null
}
if (-not(IsUserNameUnique($username)))
{
$Context.Cancel("The username is not unique.")
}
As for the extension, do you specify it using a certain property of the user account? If you do, you can use the same approach to check extensions specified for new users.