Andy2789 Posted June 27, 2018 Posted June 27, 2018 Hopefully someone with far better script writing skills than me, can help me! We are using Office 365 and have been for a number of years, but over the summer we are changing our username layout for students and staff over the summer as part of a complete overhaul. We need to add their existing username plus @ domain.com to the ProxyAddresses attribute. So when Azure resyncs after the changes their old email alias will still work for each user. I have searched Edugeek, the internet over and over and all other scripts either want to add a second domain, or replace everything that is there. If anyone can point me in the direction of a script that on bulk will go to each user, take the username add the @ domain.com and add it to ProxyAddresses Attribute I will be a very happy man!
Norphy Posted June 27, 2018 Posted June 27, 2018 $Users = Get-ADUser -filter * -properties proxyaddresses $Users | Foreach { get-aduser -identity $_.Name | set-aduser -add @{ProxyAddresses="smtp:"+$_.name+"@domain.tld"} That ought to do it. 1
Andy2789 Posted June 27, 2018 Author Posted June 27, 2018 Wow! Wasn't expecting such a quick response! Thank you, will give it a whirl now.
Boredguy Posted June 27, 2018 Posted June 27, 2018 Don't forget you will need to update 365 logon credentials if you want users to login with their new username format Set-MsolUserPrincipalName -UserPrincipalName [email protected] -NewUserPrincipalName [email protected]
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