How can we check email format for multiple users in AD

Anusha 1 Reputation point


   How can we check the email format of multiple users in Active directory at a time? is that possible using python.  


Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,799 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Gary Reynolds 9,391 Reputation points

    Hi @Anusha

    I haven't done much with Python and AD but I did help on another question which includes some details on using Python using a couple of different libraries.

    Here on the other hand here is a Powershell script which can be used to valid the mail address for users active users. You just need to change the domain name.

    get-aduser -filter 'enabled -eq $true' -properties givenname,sn,mail,samaccountname |   
                Name = $_.SamAccountName;  
                Mail = $_.Mail  
                Valid = "$($_.givenname).$($" -eq $_.mail;  
         } | Export-Csv c:\temp\mail-Report.csv -notypeinformation