Powershell Scrip to validate email address against AD

Hi

I need help to write a script to validate email address (not email address format) against AD. I have bunch of email addresses in a column on database out of which some are valid and some are not valid (that not valid ones are they moved out of company).

Thanks

February 27th, 2015 12:38pm

Just search for the address

get-aduser -Filter "EmailAddress -like 'user@domain.com'"

If it returns null the address doesn't exist.

Free Windows Admin Tool Kit Click here and download it now
February 27th, 2015 12:54pm

If your running Exchange it will be much faster to use the Exchange cmdlets

Get-Recipient <email address> 

Email address is not an indexed property in AD, and not required to be unique by AD, so Get-ADUser will have to search all the users looking for the ones that have that email address.  Exchange requires it to be unique and maintains it's own database, and uses it as an index.

February 27th, 2015 1:02pm

Hi Kalyan,

If there is any update on this issue, please feel free to reply this post directly so we will be notified to follow it up.

If you have any feedback on our support, please click here.

Best Regards,

Anna Wang

Free Windows Admin Tool Kit Click here and download it now
March 9th, 2015 3:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics