Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Migrating email aliases

$
0
0

Hi we are moving from one office 365 (not synced, cloud only) to another which is ad synced and has an onsite exchange server for admin only. I'd like to export all of our current users email aliases then import them on the exchange 2016 server which syncs with o365.

Someone mentioned to me try:

Get-Recipient -ResultSize Unlimited | Export-Clixml C:\Recipients.xml 

then copy xml to exchange server

then from exchange run:

$recipients = Import-CliXml "C:\Recipients.xml"

$Recipients|where{$_.RecipientType -eq "UserMailbox"}|foreach{Set-MailUser -EmailAddresses:$_.EmailAddresses -PrimarySMTPAddress:$_.PrimarySMTPAddress}

but i get:

cmdlet Set-MailUser at command pipeline position 1
Supply values for the following parameters:
Identity:

Not sure if theres a different way we could do this?

I've seen this to export might be better but not sure how to import....

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,PrimarySmtpAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq "smtp"} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv email-addresses.csv



Viewing all articles
Browse latest Browse all 21975

Trending Articles