ADD / Remove ProxyAddresses from Active directory Attributes

After Migration or Removing some domain from organisation, you might also need to remove SMTP address lists from Adctive directory.

For example: I have removed a domain from my active directory and now i want to remove all the from “ProxyAddresses” in active directory.

To do this, open notepad and write this code given below and then save it as scriptname.ps1

Import-Module Activedirectory

GC C:input.txt | % {

Set-ADUser $_ -Add @{ProxyAddresses="SMTP:$"}




If you want to remove Proxy Addresses then replace -Add with -Remove

and the input.txt file be containing all the usernames like:


place the input file in c:input.txt and run the script.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s