Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

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!

Posted

$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.

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...