Changing UPN from .local to .com then update proxyaddresses field with updated email

Just as a preface, I’m still a PS novice, so take it easy on me. We’ve gotten situated in O365, (which I’m not too familiar with outside of the basics) but we avoided the the UPN change until now. I think I"ve gotten the first part figured out

Import-Csv "C:\temp\test.csv" | foreach {Set-ADUser -Identity $_.Name –UserPrincipalName $_.UserPrincipalName -EmailAddress $_.Mail}

I’m not sure if I need the -Identity parameter if we just need to change the UPN and Email fields in every user account. I know I don’t have any error checking but I’ve tested this on a few test profiles I created.

The next step, which is updating the ProxyAddresses field, has me stumped. Can I get some suggestions? Also, if i’m going about this the wrong way please let me know.


Welcome to the forum. :wave:t4:

You have to specify what user account you want to change with your Set-ADUser. Therefor you need one of the unique identifiers listed in the help for Set-ADUser. I prefer to use the sAMAccountName. But if your property name is unique it’s fine.

What is your problem with it?

Hi Olaf,

Thank you for your response.

My issue with ProxyAddresses field is I have no way to change it, to my knowledge, through the Set-ADUser parameters, like I’m able to do with the UPN and Email fields. I’m not sure how to approach that change at all, honestly.

If we only had our knowledge we wouldn’t know very much at all. So what happened when you googled it? You mean to say you got 0 results?

1 Like

So I did Google it and I believe I looked at that article. I just figured I could pick some professional brains on how to maybe pipe the output from the Email attribute into the proxy address field or maybe add some error checking, if necessary. But great input, very professional.