Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Move Exchange mailboxes to O365 via PowerShell script

$
0
0

We are having a problem getting our scripting to work. We have to move 200-300 mailboxes (on a daily basis) to O365. This is an ongoing process. Currently we have over 700,000 mailboxes in the cloud. (Those numbers are correct.)

We want to automate this process by exporting the list of mailboxes from the EMC (2010) to a CSV file.  Then to run a PS script within an Azure Active Directory PowerShell.

Here is what we currently have ...

========================

$cred = Get-Credential

domain.com\<exchange-admin-account>
<password>

Import-Csv book1.csv | Select-Object -ExpandProperty `Alias' | foreach {New-MoveRequest -Remote -RemoteHostName 'webmail.domain.com' -RemoteCredential $cred -TargetDeliveryDomain 'service.domain.com' -verbose}

==============================

There is a 'disconnect between the first two pipe segments from the last pipe segment.

For example ... Import-Csv book1.csv | Select-Object -ExpandProperty 'Alias'  works well, and returns a list of the user alias' to the screen.

Most of the last pipe segment works well, also. {New-MoveRequest -Remote -RemoteHostName 'webmail.domain.com' -RemoteCredential $cred -TargetDeliveryDomain 'service.domain.com' -verbose}     This portion work well for us.

 

The 'disconnect' is that the data from the first portion does not translate into the variable to the actual MoveRequest. 

Anyone have any ideas? What are we missing?

Thank you in advance.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>