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

**URL:** <https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606>\
**Category:** PowerShell Help\
**Created:** [September 22, 2021, 10:53pm UTC](https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606 "2021-09-22T22:53:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ant](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@ant](https://forums.powershell.org/u/ant)\
**Post date:** [September 22, 2021, 10:53pm UTC](https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606/1 "2021-09-22T22:53:41Z")

</div>

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

```auto
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.

Thanks!

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [September 22, 2021, 11:46pm UTC](https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606/2 "2021-09-22T23:46:55Z")

</div>

Anthony,  
Welcome to the forum. 👋🏽

> [@ant](#):
>
> 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.

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.

> [@ant](#):
>
> The next step, which is updating the ProxyAddresses field, has me stumped.

What is your problem with it?

---

<div class="post-metadata">

**Author:** ![ant](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@ant](https://forums.powershell.org/u/ant)\
**Post date:** [September 22, 2021, 11:54pm UTC](https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606/3 "2021-09-22T23:54:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tonyd](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tonyd/32/1041_2.png) [@tonyd](https://forums.powershell.org/u/tonyd)\
**Post date:** [September 22, 2021, 11:57pm UTC](https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606/4 "2021-09-22T23:57:42Z")

</div>

> **[How to Bulk Update ProxyAddresses Attribute](https://activedirectorypro.com/how-to-bulk-update-proxyaddresses-attribute/)**
>
> In this guide, I'm going to show you how to update the ProxyAddresses attribute for single and multiple user accounts. Bulk updating the ProxyAddresses is often required when migrating to Office 365…

---

<div class="post-metadata">

**Author:** ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)\
**Post date:** [September 22, 2021, 11:58pm UTC](https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606/5 "2021-09-22T23:58:46Z")

</div>

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?

[https://www.google.com/search?q=set+proxy+address+set-aduser&ie=UTF-8&oe=UTF-8&hl=en-us&client=safari](https://www.google.com/search?q=set+proxy+address+set-aduser&ie=UTF-8&oe=UTF-8&hl=en-us&client=safari)

---

<div class="post-metadata">

**Author:** ![ant](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@ant](https://forums.powershell.org/u/ant)\
**Post date:** [September 23, 2021, 12:45am UTC](https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606/6 "2021-09-23T00:45:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:21pm UTC](https://forums.powershell.org/t/changing-upn-from-local-to-com-then-update-proxyaddresses-field-with-updated-email/17606/7 "2024-05-16T20:21:20Z")

</div>

Closed on May 16, 2024, 8:21pm UTC


