Bulk Update ProxyAddresses Using PowerShell

In this guide, you will learn how to add and remove ProxyAddresses in Active Directory with PowerShell. I’ll also demonstrate how to add, change and remove ProxyAddresses with the AD Pro Toolkit.

In this article

Add ProxyAddresses with PowerShell

To add ProxyAddresses with PowerShell you would use the set-aduser cmdlet.

Set-ADUser Abbie.Peters -add @{ProxyAddresses="smtp:Abbie.Peters2.activedirectorypro.com"}

In the above example, I’m adding a new proxyaddress to user Abbie.Peters.

You can view the users proxyAddresses in Active Directory by clicking on the attribute editor and then the proxyAddresses attribute.

active directory proxyaddresses

To remove proxyaddresses with PowerShell use the -remove parameter.

Set-ADUser Abbie.Peters -remove @{ProxyAddresses="smtp:Abbie.Peters2.activedirectorypro.com"}

Bulk Modify ProxyAddresses with AD Pro Toolkit

If you need to modify the proxyAddresses for multiple users, then I would recommend the AD Pro Toolkit. This tool makes it easy to add, remove, and change proxyaddresses for multiple users.

Download AD Pro Toolkit and see how easy it is to update ProxyAddresses.

Example 1. Bulk Add ProxyAddresses

Step 1. Create a CSV file with two columns.

  • sAMAccountName = The account you want to update
  • proxyAddresses = The proxyaddresses you want to add. Separate with comma if adding more than one.

Tip! You can use the included AD User Export Tool to export a list of users to CSV file.

CSV Example.

csv proxyaddresses

Step 2. Run the Bulk Update Users Tool

Open the AD Toolkit and click on Bulk Modify Users. Select your CSV file and click run.

add proxyaddresses toolkit

The tool will log everything on the screen. It will show you how many users were updated.

Example 2. Modify Existing ProxyAddresses

In this example, I’ll modify users ProxyAddresses.

Step 1. Create a CSV file with three columns.

  • sAMAccountName = The account you want to update.
  • proxyAddresses = The target proxyAddresses you want to change.
  • proxyAddresses_update = This column will replace the target address. (the address in column b)

CSV Example.

modify proxyaddressess toolkit

In the above CSV, the user Carole.Lloyd will have its proxyAddress SMTP:Carole.Lloyd@activedirectorypro.com updated to SMTP:C.Lloyd@activedirectorypro.com.

Step 2. Run the Bulk Update Users Tool

Open the tool and click on “Update Options” and select “Update Existing” under ProxyAddress Options. Click OK.

update existing

Next, select your CSV file and click Run.

click run button

I’ll open one of the accounts to verify it updated the proxyaddresses.

active directory update proxyaddresses

It worked. The users existing address has been changed to SMTP:C.Lloyd@activedirectorypro.com.

Example 3. Remove ProxyAddresses

Warning. This method will clear all users ProxyAddresses. I would first export the users and their ProxyAddresses to a CSV for a backup.

Step 1. Create a CSV file with two columns.

  • sAMAccountName = The account you want to update
  • proxyAddresses = Put the word remove in this column.

CSV Example.

csv remove

Step 2. Run the Bulk Update Users Tool

Select your CSV file and click Run.

remove proxyaddresses

Now if I check one of the users all of their proxyAddresses should be removed.

active directory remove proxyaddresses

Get a list of User ProxyAddresses

To get a list of all users proxyAddresses use the below PowerShell command.

get-aduser -filter * -properties proxyaddresses | select samaccountname, proxyaddresses
powershell get proxyaddresses

With the AD Pro Toolkit click on the Export Users Tool and click run.

toolkit get proxyaddresses

If you are using Azure AD connect or Office 365 then knowing how to bulk update users ProxyAddresses attribute is a must. In this guide, I showed you multiple examples for updating single accounts, adding multiple addresses, and bulk updating a list of accounts from a CSV file

PowerShell is a great tool for making mass changes to Active Directory users but for those that want a GUI option, the AD Bulk User Update tool is a simple and easy solution. 

Let me know in the comments below if you have any questions. 

Related Articles