| Automating the Linked Mailbox Creation – Cross Forest Migration |
|
|
| Written by Praveen |
| Monday, 19 September 2011 10:47 |
|
In case of cross forest migration, most of us will plan the mailbox and account migration together to avoid complexity. However, there are situations where we plan to go one by one (all the user account migration first and then the mailbox migration). In my case, I chose to do the user account migration due to some dependency to the new forest and keep the User Mailboxes still in the source forest (existing forest). As you all know, we have to create linked mailboxes in this scenario and the process would be, Note – The source forest has Exchange 2007 Servers Org.
Imagine you have many users to be migrated, definitely the activity going to eat up a lot of your time. Use the simple piece of script to finish your linked mailbox creation in few minutes …. Steps: 1. Extract the mailbox report from exchange server using below command, Get-Mailbox -Identity testif* -ResultSize 3000 |Select SamAccountName,UserPrincipalName,ExchangeGuid,Database | export-csv C:\userlist.csv Imp: I have queries only for the user identity starts with "testif", you may put own filteration according to the need. The ResultSize is given as 3000 to get all the users, because of the default limit is 1000. If you have more than 3000 do modify the command accordingly. This will give you a report in following format, #TYPE System.Management.Automation.PSCustomObject Remove the first line “#TYPE System.Management.Automation.PSCustomObject” and save it as it is. Keep in mind that this list will be used as the input user list for the script; hence only keep the user entries which are planned to migrate now. For e.g. you will have total of 2000 user and you have planned only for 100 now, keep only 100 entries and remove all 1900 entries from it(final list will be like below). SamAccountName,UserPrincipalName,ExchangeGuid,Database Now we are ready to move on to next phase(the above list can be prepaired well before the activity, so keep this ready before your migration schedule). 2. Disable the mailbox by importing the list created in the step1. 3. Run Clean-MailboxDatabase cmdlet if the mailboxes are not listed under the Disconnected Mailbox list of EMC. 4. Copy the below code and save it as .ps1 file under any folder(C:\E2K7-Scripts), and to execute the script you need to run "Set-ExecutionPolicy RemoteSigned" # Migrate your User Mailbox to Linked mailbox for Cross forest user account migration, read tips below. Note – The script is saves as _CreateLinkedMailbox.ps1 in C:\E2K7-Scripts and ensure that you have modified the details marked in differrent colors in the above script. 5. Open the Exchange Management Shell and navigate to C:\E2K7-Scripts and run below, [PS] C:\E2K7-Scripts>.\_CreateLinkedMailbox.ps1 >>c:\output.txt During the script execution it will ask you to enter the target domain admin credentials. I also have shown how to re-direct the output to different file " >>c:\output.txt"(keep in mind that the redirection works only for couple of formatted output and not all). Executing for
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
If you have see the output like " This e-mail address is being protected from spambots. You need JavaScript enabled to view it disconnected mailbox not found !!!" in the output file, that means the linked mailbox creation failed for those objects. Verify your steps and ensure those failed objects are appearing in the Disconnected mailbox list in EMC. Write your comments and issues, it may need some changes to fit your infrastructure which are marked in different colors. I strongly recommend you to test this in a test environment before trying into your production servers. -Praveen |
| Last Updated on Tuesday, 20 September 2011 09:59 |
Read In
Popular
ARCHIVES
- ► 2012 (16)
- ► 2011 (24)
- ► 2010 (31)
VISITORS






Your IP: 38.107.179.209
,
Follow Us



