AD user account creation, duplicate email address

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Forums Archives Forums Archives 5 years, 5 months ago.

  • Author
    Posts
  • #6310

    by anwak at 2013-03-26 06:53:59

    Our email is hosted in the cloud but managed by our AD. There is no exchange server.
    The issue is, when someone creates a new AD user account, then there is no way to find out, if the SMTP address (mail attribute) is already assigned to another (existing) AD account in the domain.
    We run a daily scheduled report using a PowerShell script to find the AD accounts with the same email address (duplicates).

    There is no way to find out while creating a new AD account and filling in the email address, if the email address is already assigned to another AD user in the domain.
    Is there a tool available, or a PowerShell script to verify a duplicate email address in the domain (not inside the same OU) while creating a new AD user account.

    by kittH at 2013-03-26 12:42:44

    Using the MS AD module you could use the following command:
    Get-ADUser -Filter {EmailAddress -eq 'anwak@company.com'}
    If your new user creation is scripted you would add something like this to check if an email address is in use:
    If (-Not(Get-ADUser -Filter {EmailAddress -eq "$username@company.com"}))
    {
    New-ADUser Script goes here
    }

You must be logged in to reply to this topic.