Alexandre Michel
asked on
How can I clean smtp addresses aliases exported from Office 365
Hi Experts
I am planning for a merge of 3 different Office 365 tenancies into one.
I am trying to get a clean list of
All the powershell scripts I could find would give the alias email addresses as follow
Note, these can be in any order
the next one are "smtp:" in any order
and thus I would like to drop the following
I have tried to do this in Excel, but it is getting too hard
Clarification: What I am realy trying to do is to re-import all these addresses into the new tenancy, so if there is another way to export/import or sync email addresses, I am opened to alterative solutions
I am planning for a merge of 3 different Office 365 tenancies into one.
I am trying to get a clean list of
- Mailboxes
- Main email address
- Alias emails address(es) if any
All the powershell scripts I could find would give the alias email addresses as follow
SPO:SPO_xxx@SPO__xxx SIP:name1@company.com SMTP:name1@company.com smtp:name1@company.onmicrosoft.com smtp:name2@company.com smtp:name3@company.com X500:/stuff_here with space and /
Note, these can be in any order
smtp:name2@company.com SMTP:name1@company.com smtp:name1@company.onmicrosoft.com SIP:name1@company.com smtp:name3@company.com SPO:SPO_xxx@SPO__xxx
or might not have all types of addressesSMTP:name1@company.com smtp:name1@company.onmicrosoft.com SIP:name1@company.com smtp:name3@company.com SPO:SPO_xxx@SPO__xxx
From the above, I would like to extract the followingname1@company.com, name2@company.com, name3@company.com
1st one is "SMTP:"the next one are "smtp:" in any order
and thus I would like to drop the following
SPO:SPO_xxx@SPO__xxx (because it starts with "SPO:")
SIP:name1@company.com (because it starts with "SIP:")
X500:/stuff_here with space and several / (because it starts with "X500:")
smtp:name1@company.onmicrosoft.com (because it ends with ".onmicrosoft.com")
I have tried to do this in Excel, but it is getting too hard
Clarification: What I am realy trying to do is to re-import all these addresses into the new tenancy, so if there is another way to export/import or sync email addresses, I am opened to alterative solutions
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@Sunil, thanks for that. I will try
However, to complicate things, there is more than one domain (domain1.com, domain2.co.uk, etc...)
Should I use your script several times, once for each domain, or is there a better way to do this?
However, to complicate things, there is more than one domain (domain1.com, domain2.co.uk, etc...)
Should I use your script several times, once for each domain, or is there a better way to do this?
ASKER
@Vasil, thanks for that. That looks cool. I will try (tomorrow - it is 11:30PM here)
But why does it say "Get-Mailbox vasil"? is that for the "vasil" mailbox only?
What should I use to check all the mailboxes? Maybe I need to use @Sunil's method and yours together???
But why does it say "Get-Mailbox vasil"? is that for the "vasil" mailbox only?
What should I use to check all the mailboxes? Maybe I need to use @Sunil's method and yours together???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@Vasil, Looking at your 2nd suggestion, how do I get the main email address first and then the aliases after , separated by commas?
ASKER
@Sunil,
That looks better than I was ever able to do using Excel. Thanks
I am getting these types of answers
smtp:name1@domain.com;smtp :nam1@doma in2.com;SM TP:name@do main.com
So it looks like SMTP is that last one
Can I use that string of characters to create the mailboxes in the new Office 365 tenancy?
From what I am reading I need to use for example
Set-Mailbox Angelina -EmailAddress Angelina-NEW01@o365info.co m,Angelina -AliasTest 02@o365inf o.com
or
Set-Mailbox Angelina -EmailAddress Angelina-Alias02@o365info. com,Angeli na-Alias03 @o365info. com,SMTP:A ngelina-NE W01@o365in fo.com
That looks better than I was ever able to do using Excel. Thanks
I am getting these types of answers
smtp:name1@domain.com;smtp
So it looks like SMTP is that last one
Can I use that string of characters to create the mailboxes in the new Office 365 tenancy?
From what I am reading I need to use for example
Set-Mailbox Angelina -EmailAddress Angelina-NEW01@o365info.co
or
Set-Mailbox Angelina -EmailAddress Angelina-Alias02@o365info.
If you keep the prefix, you can directly use the resulting string against the -EmailAddresses parameter as in your last example above, the position of the SMTP entry in the string doesnt matter. So just go with this approach.
you should be good as suggested by Vasil, test with one or two accounts and if any issues let us know...
ASKER
Thank you both for your input. Saved me hours...
Open in new window