Skip to content

How to Bulk Update ProxyAddresses Attribute

In this guide, I’m going to show you how to update the ProxyAddresses attribute for single and multiple user accounts. 

Bulk updating the ProxyAddresses is often required when migrating to Office 365, creating new accounts, adding a new domain and so on. 

To bulk update user accounts you will need to use PowerShell or a third party tool. Don’t worry if you are not familiar with PowerShell as I provide step by step instructions. If you want to skip PowerShell all together I’ll show you the GUI tool I created that is easy to use and requires no coding. 

Examples in this guide: 

How to Add ProxyAddresses using PowerShell

This first example, I’ll show you how to add a ProxyAddresses using PowerShell. 

Using the -add parameter will not remove or update existing addresses, it will just add the additional address you specify. 

I’m going to add a new address to the user account Adrienne.Williams. 

First I’ll run a command to get the users current ProxyAddresses

get-aduser adrienne.williams -Properties ProxyAddresses | select Name, ProxyAddresses

You can see this user has one ProxyAddress. Now I will use the command below to add a second proxyaddress.

Set-ADUser Adrienne.Williams -add @{ProxyAddresses="smtp:adrienne.williams.mail.onmicrosoft.com"}

Now I’ll list the user’s addresses again and you can see the user now has two addresses. 

 

If you want to add multiple ProxyAddresses at once use this command 

Set-ADUser Adrienne.Williams -add @{ProxyAddresses="smtp:adrienne.williams.mail.onmicrosoft.com,SMTP:adrienne.williams.mail.onmicrosoft.com" -split ","}

With the above command you can add as many addresses as you want, just separate each one with a comma. 

How to Replace ProxyAddresses using PowerShell

You can use the -replace parameter to replace the user’s current ProxyAddress value. 

Warning: Using the -replace parameter will replace all addresses with the values you provide. 

Let’s list the user’s current addresses

get-aduser adrienne.williams -Properties ProxyAddresses | select Name, ProxyAddresses

So this user has two addresses listed. I’m going to pretend these addresses are wrong or no longer needed and replace them all. 

Use this command to replace the ProxyAddresses

Set-ADUser Adrienne.Williams -replace @{ProxyAddresses="SMTP:adrienne.williams.activedirectorypro.com"}

Now I’ll check the account

You can see the -replace command cleared out both addresses and replaced it with the single address. 

If you want to replace the value with multiple address use this command.

Set-ADUser Adrienne.Williams -replace @{ProxyAddresses="SMTP:adrienne.williams.activedirectorypro.com,SMTP:adrienne.williams.ad.com" -split ","}

How to Remove ProxyAddresses using PowerShell

You can use the -remove parameter to remove single or multiple addresses. 

Remove single address

Set-ADUser Adrienne.Williams -remove @{ProxyAddresses="SMTP:adrienne.williams.activedirectorypro.com"}

Remove multiple addresses

Set-ADUser Adrienne.Williams -remove @{ProxyAddresses="SMTP:adrienne.williams.activedirectorypro.com,SMTP:adrienne.williams.ad.com" -split ","}

Bulk Add ProxyAddress for Multiple Accounts using PowerShell

To update multiple user accounts you will need to set up a CSV file with a samaccountname column and proxyaddresses column. 

Enter as many proxyaddresses as you need and separate them by a comma.

Here is an example of a CSV file. 

For this example, I’m going to update all the users in the Administrations organizational unit. To list all the users current addresses in an OU run the command below. You will need to change the value of the -SearchBase to the distinguished name of the OU. 

get-aduser -filter * -SearchBase "OU=Administrations,OU=ADPRO Users,DC=ad,DC=activedirectorypro,DC=com" -Properties ProxyAddresses | select Name, ProxyAddresses

You can see two users have proxyaddresses and the rest do not. 

To update these accounts with the information in the CSV file, use the command below. You will need to update the path to your CSV file.

Import-Csv "C:\it\bulk-proxy2.csv" | foreach {Set-ADUser -Identity $_.samaccountname -add @{Proxyaddresses=$_.Proxyaddresses -split ","}}

Now I’ll check the values if they have been updated. 

Great!

It looks like all the accounts in the Administrations OU has been updated from the CSV file. 

Bulk Update ProxyAddress for Multiple Accounts using the AD Bulk Update GUI Tool

I often get asked to bulk update Active Directory user attributes such as email address, phone number, street address, department and so on. 

To save time  I created the AD Bulk User Update Tool.  This GUI tool makes it super easy to bulk update any user attribute, you can even update multiple attributes at once. 

All you need is a CSV file with the samaccountname and the attribute you want to update. The tool also comes with a CSV template to make the setup even easier. 

To update the proxyaddresses I can use the same CSV file I used in the previous example. 

Now just open the tool, select the CSV file and click Run. 

So easy! 

To see more examples of the AD Bulk User tool see the article below

How to bulk modify active directory user attributes 

Summary 

If you are using Azure AD connect or using 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. 

Recommended Tool: SolarWinds Server & Application Monitor (SAM)

This utility was designed to Monitor Active Directory and other critical applications. It will quickly spot domain controller issues, prevent replication failures, track failed logon attempts and much more.

What I like best about SAM is it’s easy to use dashboard and alerting features. It also has the ability to monitor virtual machines and storage.

Download Your Free Trial of SolarWinds Server & Application Monitor. 

Leave a Comment