Modify Proxyaddresses Domain

This powershell snippet is used to replace a domain in all values in a user’s proxyAddresses attribute.  It requires using Microsoft’s ActiveDirectory module.  It is is capable of bulk modifying all users in an OU or can modify a single user if you specify their DN.  In the script below, modify the SearchBase and replace and

Import-Module ActiveDirectory
Get-ADUser -Filter * -SearchBase 'OU=Test,DC=domain,DC=local' -Properties proxyaddresses | Foreach {Set-ADUser -identity $_ -Replace @{'ProxyAddresses' = @($_.proxyaddresses -Replace "","")}}


Leave a Reply

Your email address will not be published. Required fields are marked *