Bulk change all O365 email addresses

Hi,
got forwarded from http://community.office365.com/en-us/f/155/p/273731/836967.aspx#836967 to this forum.
To make it short: I need to remove all of my Office 365 domains from the current tenant, even though they might still be in use for userprincipalname, emailaddresses or primarysmtpaddress. Mostly we're talking about MailUser-objects. 
The goal is to change all of the above values to [email protected] .
I already tried several scripts - some were outdated, some were not working for Office 365.  The only one which (particularly) worked out was this one:
get-mailuser -resultsize unlimited | foreach { set-mailuser -identity $_.identity -emailaddresses "SMTP:$($_.primarysmtpaddress)"}
Does anyone have any idea on how to solve this?
Best,
Daniel

To list all mailboxes that have aliases matching a particular domain, use the following:
$allm = Get-Mailbox -Filter {Emailaddresses -like "*@domain.com"}
To change the aliases, use this:
$allm | % { Set-Mailbox $_.Identity -EmailAddresses $_.Emailaddresses.Replace("domain.com","domain.onmicrosoft.com") }
And repeat the same for contacts, mail users, etc. Note that you will need to REMOVE the @domain.onmicrosoft.com address first, if it is already added on those objects.
To do the same for the UPNs, use this:
$all = Get-MsolUser -all
$all | ? {$_.UserPrincipalName -like "*@domain.com"} | % { Set-MsolUserPrincipalName -UserPrincipalName $_.UserPrincipalName -NewUserPrincipalName $_.UserPrincipalName.Replace("domain.com","domain.onmicrosoft.com") }

Similar Messages

  • Can I change my iCloud email address and keep all of my music, apps, files and mail in the cloud and on all of my devices?

         Ok, so here's the deal. I want to change my iCloud email address. Ultimately I want to keep the same Apple ID and simply edit the part before the '@icloud.com'. If this is not possible, can I make a new Apple ID and transfer all of music, apps, files, and mail to the new Apple ID and all of my other devices?
                        Thanks in advance, Scotty P.

    You cannot change your iCloud email address but you can setup a new alias: http://help.apple.com/icloud/#/mm6b1a490a
    You cannot transfer purchases from one AppleID to another.

  • HT4847 How can I change my iCloud email address without losing all my data and what not???? Please help...

    How can I change my iCloud email address without losing all my data and what not???? Please help...

    Welcome to the Apple Community.
    You can't change it but you can create an alias to use.

  • I am unable to change my iCloud email address on my phone. It is changed and verified in my account. How do I change it so that my iPhone is not showing my old address? Many thanks to all in advance

    I am unable to change my iCloud email address on my iphone. It is changed and verified in my account and when I log in to Cloud on my PC its fine. However when I go through the settings on my iphone (3GS) it still coming up with my now inactive old email address.
    How do I change it so that my iPhone is not showing my old email address and shows my new and verified email address? Many thanks to all in advance

    If you have given correct info about you ios 6.1.3 - all you need to do is delete account. You will be able to sign in with new one afterwards. Make sure you don't delete any info when you see those prompts.

  • My ipod has had a previous owner How do I change my ipods email address so that when I try to down load anything it asks for the previous owners password but when I go to my account it says its my email my account but not when I try to download????

    My ipod has had a previous owner How do I change my ipods email address so that when I try to down load anything it asks for the previous owners password but when I go to my account it says its my email my account but not when I try to download can anyone please help me ????Plus it still has some of the previous owners pictures and videos on it that I want to delete and can't????? Also is there a way to kill the apps that u have used throughout the day the battery doesn't last long at all ??????

    - How did you dlete stuff from the iPod? If you have a 1G or 2G iPod and deleted the stuff by going to Settings>Genera.>Reset>Erase aall contents and settings without being connected to a power source, the battery dies before he erase was comleted since it can take hour.
    - In any event try the following:
    - Connect to a chaging sour for three hours.
    - Reset the iPod and then connect to the computer and try to restore va iTunes.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Next try placing the iPod in recovery moe and then try to restore. For recovery mode:
    iPhone and iPod touch: Unable to update or restore
    - Last try DFU made and restore.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings

  • HT204053 I changed my AppleID email address because my old address expired, and I can access it on iTunes, but whenever I try to log into iCloud from my MacBook it won't let me sign in under the new AppleID - the old ID keeps showing up. How do I change t

    I changed my AppleID / email address after my old email expired, and now whenever I go to sign into iCloud on my computer it still shows my OLD AppleID in the log-in and it won't let me change it. So I can't sign into iCloud! I can still sign into iTunes though from my iPhone and laptop, but iCloud isn't working anymore, where do I go to update my AppleID in the log-in for iCloud???

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    Providing you are simply updating your existing details and not changing to another account, when you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again.
    In order to change your Apple ID or password for your iCloud account on your computer, you need to sign out of the account from your computer first, then sign back in using your updated details. (System Preferences > iCloud, click the sign out button)
    In order to change your Apple ID or password for your iTunes account on your iOS device, you need to sign out from your iOS device first, then sign back in using your updated details. (Settings > iTunes & App store, scroll down and tap your ID)
    If you are using iMessages or FaceTime, you will also need to log out and into your ID there too.

  • HT204053 how do i change my icloud email address from the one i already have input?

    how do i change my icloud email address from the one i already have input?

    Hi sparkie,
    You cannot change your iCloud email address. It is an @me.com address, and is associated specifically with that iCloud account. If you want a different @me address assigned, you have to delete the current iCloud account and set up a new one.
    Here is a link with all the support information for iCloud:
    http://www.apple.com/support/icloud/
    Hope this helps!
    Cheers,
    GB

  • TS4020 Can I change my iCloud email address name without creating a new account?

    CCan I change my iCloud email address name without creating a new account?

    Once you have created an iCloud account and chosen an @icloud.com address to go with it you can't change the address (short of creating an entirely new account).
    However, all is not lost. You can add up to three 'email aliases' - these are additional addresses (not accounts) which deliver into the same inbox as the main account. (In fact it's a good idea to give out alias addresses, rather than the main address, because if they attract spam you can easily change them.) (New aliases can only be @icloud.com ones; @me.com addresses cannot now be created.)
    You should be aware before you start that once you've created an alias you cannot turn that address into a full iCloud account or move it to another account.
    More information on aliases here: http://help.apple.com/icloud/#mm6b1a490a

  • I have changed my email address and changed my Apple ID. However iCloud on my ipad and an ipad mini still shows my old email address. How can I change my iCloud email address?

    I have changed my email address and changed my Apple ID. However iCloud on my ipad and an ipad mini still shows my old email address. How can I change my iCloud email address?

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    Providing you are simply updating your existing details and not changing to another account, when you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again.
    In order to change your Apple ID or password for your iCloud account on your computer, you need to sign out of the account from your computer first, then sign back in using your updated details. (System Preferences > iCloud, click the sign out button)
    In order to change your Apple ID or password for your iTunes account on your iOS device, you need to sign out from your iOS device first, then sign back in using your updated details. (Settings > iTunes & App store, scroll down and tap your ID)
    If you are using iMessages or FaceTime, you will also need to log out and into your ID there too.

  • HT2623 how can I change my icloud email address?

    I have not been able to change my icloud email address and would like to do so. I know before this was not an option. Has it changed?

    Nothing has changed: once you have created an iCloud account and chosen an @icloud.com address to go with it you can't change the address (short of creating an entirely new account).
    However, all is not lost. You can add up to three 'email aliases' - these are additional addresses (not accounts) which deliver into the same inbox as the main account. (In fact it's a good idea to give out alias addresses, rather than the main address, because if they attract spam you can easily change them.) (New aliases can only be @icloud.com ones; @me.com addresses cannot now be created.)
    You should be aware before you start that once you've created an alias you cannot turn that address into a full iCloud account or move it to another account.
    More information on aliases here: http://help.apple.com/icloud/#mm6b1a490a

  • HT5621 how can I change my iCloud email address?

    I want to change my icloud email address but I dont know how. Any ideas?

    Welcome to the Apple Community Kate.
    Firstly, you need to change your details with Apple,  Start here, change your country if necessary and go to manage your account. You may have already done this.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    Providing you are simply updating your existing details and not changing to another account, when you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again.
    In order to change your Apple ID or password for your iCloud account on your computer, you need to sign out of the account from your computer first, then sign back in using your updated details. (System Preferences > iCloud, click the sign out button)
    In order to change your Apple ID or password for your iTunes account on your iOS device, you need to sign out from your iOS device first, then sign back in using your updated details. (Settings > iTunes & App store, scroll down and tap your ID)
    If you are using iMessages or FaceTime, you will also need to log out and into your ID there too.

  • I think I need to change my primary email address

    Hi, I am a newbie on here, not awfully techy minded but have struggled my way to this forum as I cannot make sense of the BT help.
    I get huge amounts of spam emails usually via mailerdemon that despite setting to spam still get into my inbox.  A lot go straight into my spam.  They all seem to relate to cameras and sales and they started when I ordered a remote control ages ago from what was probably a less than reputable company.  Sometimes these up are to 20 or more all sent at the same time. and from all different addresses.   I could tolerate this, it was a nuisance especially when addressing emails all these recipients come up when I type in the first letter or two of a contact but when I got into work this morning, I found an email that I defintely hadn't sent at 4.20 am this moring (I was tucked up in bed) asking how I was and giving a lucky link.  Embarassing as it had somehow apparently come from my home email address and had been sent to a lot of people I had emailed in the last couple of weeks  but not everyone in my contact book and also sent to some old defunct contacts that I haven't sent to for ages.  
    So now I've got to do something.
    Thinking about it, I had to challenge a credit card transaction a while ago, and could only prove against the company because the IP address they said my email address had come from was not mine.
    I have Bullguard installed on my computer, I thought that would stop this sort of thing?
    So here's what I want to do.
    Change the password on my current by yahoo email account.
    Change the email address of the primary account holder (me).
    Make sure the old email address is closed.
    And make sure that in future I use sub accounts for all non important emails.
    What is the quick and easy guide please to changing the main email address and closing the old one.
    Will I lose a sub account I already have (my son's).
    And what should you use your main email account for only?
    Any other advice?When I did speak to someone from BT they just wanted me to set up a new sub account, but I don't think that willl solve the problem.
    I really would appreciate your thoughts.
    Solved!
    Go to Solution.

    Hi
    I am sorry to see you are having problems with your BT Service
    I suggest you contact the forum mods they should be able to get this problem sorted for you this is a link to them http://bt.custhelp.com/app/contact_email/c/4951
    They normally reply by email or phone directly to you within 3 working days they will take personal ownership of your problem until resolved and will keep you informed of progress
    They are a UK based BT specialist team who have a good record at getting problems solved
    This is a customer to customer self help forum the only BT presence here are the forum moderators
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • I want to change my primary email address

    I wan to change my btinternet primary email address to another one, either my sub account address or a new one.  I don't mind which.  I've been trying for 9 days now to have this done, and BT keep saying they'll do it but they haven't.
    Has anyone else tried to do this and if so have they actually succeeded in getting a new primary email address?
    Thanks
    Solved!
    Go to Solution.

    Hi harrybeadlebaum
    Thank you for your reply it is much appreciated.
    Basically I want to change my primary email address as I've changed my surname following separation from my husband, and don't want any association with my old name which it was.  I wish it was only spam I want to get rid of.  Yes, you're right, I'm using webmail not outlook or similar.
    Unfortunately I've already begun the long and tortuous process of getting my primary email address changed and am now on day 9 of frustrating emails, telephone calls with the call centre in India (or somewhere)  Each time I talk to someone they assure me it will be done in 24 hours, 48 hours, by the end of the day..... I expect this sounds familiar to you if you've been there?  Your comment about a breakdown in communication is perhaps an understatement!  I've come to the conclusion they fully understand what I want but just aren't interested in seeing it through. All they want to know at the end of the phone call is if I'm happy with how they've dealt with my call.  Well yes I am at the time, as they understand what I want, relay back to me what I want, but don't actually deliver.  Promises, promises, promises.
    I've now lodged a formal complaint to BT and am sure I'll get the usual responses about process, systems, blah blah blah...
    Sigh.  As you may guess I'm absolutely fizzing about it all!!  I've already wasted hours of my life chasing it, just can't stop though - don't give up!!  However, am pleased to know that someone has got it done,  so I'll just keep trying and boy is it trying....
    Rant over,  I'll let everyone know how I get on!
    From a very irate and now crabby mrs blobby

  • Can you change the icloud email address linked to you icloud account?

    Some how the my husbands iCloud email address got linked to my iCloud account is there a way to change the iCloud email address to another?

    Not without creating a new iCloud account.  If you want to do this, create a new ID with the email address you want to use, then go to Settings>iCloud on your phone and turn all data you are syncing with iCloud (contacts, calendars, etc.) to Off.  When prompted choose to keep the data on your device.  (If you are syncing iWork documents with iCloud, also open your iWork apps and turn off iCloud syncing and choose to keep the documents on your phone.)  After everything is turned off, scroll to the bottom and tap Delete Account.  Next, set up a new iCloud account using your new ID, then turn syncing for your data (contacts, etc.) back to On.  When prompted, choose Merge.  This will upload the data to your new account.
    This will not move your photo stream, however.  If you have photos in photo stream that are not in your camera roll and that you haven't backed up anywhere else you will need to save these before deleting the account.  To do this, open your photo stream album on your device in the thumbnail view, tap Edit, tap all the photos to select them, tap Share, then tap Save to Camera Roll.  You can then delete the iCloud account and your photos will stay in your camera roll.

  • How do I copy all the email addresses in my Address Book quickly?

    How do I copy all the email addresses in my Address Book quickly so that I can email a change of address?

    From the Address Book help file:
    Notify contacts when your vCard changes
    When you change your contact information, you can send a group email message to your contacts. The message contains your updated vCard and a message from you.
    1. If you don’t have a group of addresses, create one.
    2. Choose File > Send Updates.
    3. In the Send Updates dialog, select one or more groups to notify. If some contacts in the group have multiple email addresses, you can choose which address to use.
    4. Type a subject title and a message, and then click Send.

Maybe you are looking for

  • Can you transfer between itunes accounts using home sharing

    I am wanting buy an Ipad 2 as a present and pre load some apps for them on it. Ill have to sync it to my itunes account to do this. so how do i go about ensuring what i have downlaoded doesnt get lose when they then use their itunes account? Would ha

  • Domain redirect and Internet Explorer  behavior with cookies

    Hi team, I'd like to ask if the following behavior is "normal" or if there are some possible or better workarounds. 1. My application uses HTMLDB internal authentication (via login page). Session management therefore is based on cookies. 2. I registe

  • Need help with a basic script to resize image then resize the canvas

    I am new to photoshop scripting, and have come across a need to force an image to be 8"x10" at 300dpi (whether it is vertical or horizontal) I need to maintain the correct orientation in the file, so an Action will not work, I believe I have to imple

  • New apple aluminium keyboard with iBook G4

    Is this keyboard compatible with my laptop? I have some documents i need to type up, and would like to go an ergonomic route, by using an external, full size keyboard. Anyone know if i can use the new Apple keyboard with my iBook? I'm running Mac OSX

  • How to save the Alerts obtained from the Alert profile

    Hi all I have an issue- I want to save alerts obtained daily for the specific alert profile. Are the alerts saved in the table. I want to have the alerts created on the date wise with all the specific informations such as for which material, orders a