24 March 2019

Remove .local address before O365 Migration

I was recently performing an O365 migration for a client who had lots of domain.local aliases.
There was no policy enforcing these addresses, and their accounts weren't picking up email address policies either.

The best way to find out who's got the .local address and then remove it is by running the following commands/scripts:


get-mailbox | where {$_.emailaddresses -like “*domain.local*”}


This will show you who has the domain.local address.  Once you've worked this out, you can then run the following script, which will go through and make sure that address is completely deleted from each mailbox alias.


$users = get-mailbox | where {$_.emailaddresses -like “*domain.local*”}
foreach ($user in $users)
{
$addresses = (get-mailbox $user.alias).emailaddresses
$fixedaddresses = $addresses | where {$_.proxyaddressstring -notlike “*domain.local”}
set-mailbox $user.alias -emailaddresses $fixedaddresses
}


The bold sections is where you need to update the domain name to whatsoever your .local address is.

2 comments:

  1. Your post clearly shows that there is hardly anyone who has a grip on domain.local like you. I also have some domains that I can easily migrate now. Buy Essay Online

    ReplyDelete
  2. Fantastic job here. I really enjoyed what you had to say. Keep heading because you surely bring a new voice to this subject. Not many people would say what you've said and still make it interesting. Well, at least I'm interested. Cant wait to see more of this from you. Also, please check out about our services: https://assignmenthelp.us/ thanks.

    Math Assignment Help
    College Assignment Help
    Do My Assignment
    Finance Assignment Help Online
    ENGL V01A assessment answers
    FELM4026 assessment answers
    LS311-5 assessment answers
    BUS303 assessment answers

    ReplyDelete