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.
https://learn.microsoft.com/en-us/answers/questions/948475/python-set-attributes-ldap.html
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 |
foreach-object{
[PSCustomObject]@{
Name = $_.SamAccountName;
Mail = $_.Mail
Valid = "$($_.givenname).$($_.sn)@yourmaildomain.com" -eq $_.mail;
}
} | Export-Csv c:\temp\mail-Report.csv -notypeinformation
Gary.
Any reason for using Python, instead of the PowerShell cmdlets?
like we need to verify the users mail id is in correct format or not.
Eg;- firstname.lastname@keyman .com