CyBeRkId2002 Posted July 30, 2021 Posted July 30, 2021 (edited) Hi all, I am looking at changing our email addresses from domain name to a new trust format. This is on a domain synced with Azure AD Sync. I believe what I need to do is: amend the UPN suffix to the new domain in AD remove the SMTP:oldemailaddress record from the proxy field add an smtp:oldemailaddress record to the proxy field add an SMTP:newemailaddress record to the proxy field Is this correct? Does anyone have a script which does this on a whole OU? Edited July 30, 2021 by CyBeRkId2002
slugshead Posted July 30, 2021 Posted July 30, 2021 I had a real pain removing ProxyAddresses last week (Had like 6 for every user). Since we don't use exchange for our email anymore they were unneeded. It's a similar situation too you though, I had on prem AD synced to azure. Our email addresses in AD profiles are at a different domain, but I needed them to be @correct domain. Two stages, one was updating the mail field in AD users and resyncing and then removing all of the ProxyAddresses field. Update the mail field with UPN - This was across all user objects mind Get-ADUser -LDAPFilter '(userPrincipalName=*)' ` -Properties userPrincipalName,mail | Select-Object * | ` ForEach-Object { Set-ADObject -Identity ` $_.DistinguishedName -Replace ` @{mail=$($_.userPrincipalName)} } Clear proxyAddresses by OU Get-ADUser -Filter * -SearchScope Subtree -SearchBase “OU= DC=” -Properties proxyaddresses | Set-ADUser -Clear proxyaddresses
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now