Skip to main content
Proxy Basics

How to Change Proxy Address in Active Directory: The 2026 Guide

7 min read

How to Change Proxy Address in Active Directory: The 2025 Guide

In the realm of Windows Server administration, the proxyAddresses attribute is one of the most critical yet misunderstood fields in Active Directory (AD). While the term 'proxy' often leads network engineers to think of web proxies, in the context of AD, this attribute dictates how a user receives email within an Exchange or hybrid Office 365 environment.

As a senior infrastructure expert, I manage thousands of these attributes annually. An incorrect proxy address configuration is a leading cause of mail flow disruption and Non-Delivery Reports (NDRs). This guide provides the definitive methodology for modifying these addresses safely, using both graphical interfaces and automation scripts.

Understanding the proxyAddresses Attribute

Before making changes, it is vital to understand what you are editing. The proxyAddresses attribute is a multi-valued property linked to user, contact, and group objects. It stores one or more email addresses (X400, X500, SMTP) that the Exchange Mailbox Submission Service uses to route mail.

The Capitalization Rule (The Primary SMTP)

Active Directory uses a specific syntax to determine the 'Primary' SMTP address:

  • Capital SMTP: (e.g., SMTP:j.doe@domain.com): This is the Primary reply address. It appears in the 'From' field.
  • Lowercase smtp: (e.g., smtp:john.d@domain.com): These are Secondary aliases. Mail sent to these addresses will be delivered to the mailbox, but they will not be used for outgoing replies.
  • When you change a proxy address, you are essentially rewriting this list of strings.

    Method 1: Using Active Directory Users and Computers (ADUC)

    For one-off changes, the graphical interface is often the safest method for beginners to prevent accidental bulk overwrites.

    Step 1: Enable Advanced Features

    By default, the proxyAddresses attribute is hidden in the basic ADUC view.

    1. Open Active Directory Users and Computers (dsa.msc). 2. Click the View menu in the top navigation bar. 3. Check Advanced Features.

    Step 2: Access the Attribute Editor

    1. Locate and right-click the target User Object. 2. Select Properties. 3. Navigate to the Attribute Editor tab.

    Step 3: Edit the Proxy Addresses

    1. Scroll down the list to find proxyAddresses. 2. Click Edit.

    Here, you will see a list of values.

    Scenario A: Adding an Alias

  • Click Add.
  • Type smtp:new.alias@domain.com (lowercase).
  • Click OK.

Scenario B: Changing the Primary Address This is a common trap. To change the primary address without losing the old one: 1. Find the current SMTP:user@domain.com entry. 2. Edit it to be lowercase smtp:user@domain.com. 3. Add a new entry (or edit another alias) with the uppercase SMTP:new.user@domain.com. 4. Critical: You cannot have two entries starting with uppercase SMTP. AD will throw an error or force the other to lowercase.

Method 2: PowerShell Automation (Recommended)

For any serious administrator or web scraping developer managing users programmatically, PowerShell is the only viable option. It allows for validation, logging, and bulk processing.

Finding Proxy Addresses

Before changing, you must query the current state.

Basic query to see all proxy addresses for a user

Get-ADUser -Identity "j.doe" -Properties proxyAddresses | Select-Object -ExpandProperty proxyAddresses

Finding users with a specific proxy address pattern (Audit)

Get-ADUser -Filter * -Properties proxyAddresses | Where-Object { $_.proxyAddresses -like "*@old-domain.com" }

Adding a Proxy Address

Use the -Add parameter. This is safe because it appends to the list rather than overwriting existing data.

Add a secondary alias

$user = "j.doe" $newAlias = "smtp:john.doe.sales@domain.com"

Set-ADUser -Identity $user -Add @{proxyAddresses=$newAlias}

Removing a Proxy Address

Use the -Remove parameter.

Remove a specific alias

$oldAlias = "smtp:legacy.alias@domain.com"

Set-ADUser -Identity $user -Remove @{proxyAddresses=$oldAlias}

Replacing (Swapping) the Primary SMTP Address

This is the most complex operation. Because the proxyAddresses attribute is a multi-valued list, you cannot simply 'edit' one line in PowerShell easily without retrieving the whole object, modifying the array in memory, and writing it back.

Here is a robust script to handle the Primary SMTP switch while preserving secondary aliases:

$UserIdentity = "j.doe"

$NewPrimarySMTP = "john.doe@newdomain.com"

1. Get the user and current proxy addresses

$user = Get-ADUser -Identity $UserIdentity -Properties proxyAddresses

2. Process the list

We create a new list to overwrite the attribute

$newProxyList = @()

foreach ($address in $user.proxyAddresses) { if ($address -cmatch "^SMTP:") { # If it is currently the Primary SMTP (uppercase), make it lowercase (secondary) $newProxyList += $address -replace "SMTP:", "smtp:" } elseif ($address -cmatch "^smtp:") { # If it is already secondary, keep it as is $newProxyList += $address } else { # Keep non-smtp addresses (x500, x400) as is $newProxyList += $address } }

3. Add the NEW Primary SMTP (Uppercase)

$newProxyList += "SMTP:$NewPrimarySMTP"

4. Write the changes back to AD

We use -Replace to overwrite the entire array

Set-ADUser -Identity $UserIdentity -Replace @{proxyAddresses=$newProxyList}

Write-Host "Successfully updated primary SMTP for $UserIdentity to $NewPrimarySMTP" -ForegroundColor Green

Managing Duplicate Proxy Addresses

Active Directory enforces uniqueness on the proxyAddresses attribute across the entire forest. If you attempt to add an address that already exists on another user, you will receive the following error:

> *The value provided for this attribute was not unique. This is a problem with the object's proxyAddresses property.*

How to Find the Owner of a Duplicate

If you need to assign an address but AD claims it is taken, use this snippet to find the culprit:

$TargetEmail = "smtp:sales@domain.com"

Get-ADUser -Filter * -Properties proxyAddresses | Where-Object { $_.proxyAddresses -contains $TargetEmail } | Select-Object Name, UserPrincipalName, DistinguishedName

Web Scraping and Automation Context

While this article focuses on Active Directory management, you might be looking for this information because you are building an automation tool (perhaps a Python or C# dashboard) to manage users.

If you are using Python to interact with AD via the ldap3 library:

from ldap3 import Server, Connection, ALL, MODIFY_ADD, MODIFY_REPLACE

server = Server('ldap://your-domain-controller', get_info=ALL) conn = Connection(server, 'CN=admin,DC=domain,DC=com', 'password', auto_bind=True)

Adding a proxy address (must be fully qualified string)

dn = 'CN=John Doe,OU=Users,DC=domain,DC=com' changes = {'proxyAddresses': [(MODIFY_ADD, ['smtp:python.alias@domain.com'])]}

conn.modify(dn, changes) print(conn.result)

Summary & Best Practices

1. Never delete the X500 address found on users migrated from Exchange. This prevents historical calendar items from breaking. 2. Always preserve the old email as a lowercase smtp: alias when changing a primary address to ensure continuity during the transition period. 3. Use PowerShell for any operation involving more than one user to minimize human error.

By following these methods, you can ensure your Active Directory environment remains clean and your email routing functions flawlessly.

Share: