Set User Features and Mailbox Limits after Linked Mailbox Conversion Print E-mail

Written by Praveen   
Thursday, 03 November 2011 18:17

I already have shared a script for migrating user mailbox into linked mailbox during the cross forest migration scenario in one of my previous posts, see here. Sometime(I faced all the time) during this process you would have observed that after the creation of linked mailboxes all manually configured limit, mailbox features are set back to the default. I have created two small of power shell command combination to import the features and the limits from a csv file.

Set the limit, follow this

Mandatorily, we need to extract the each mailbox limit details from exchange data before the linked mailbox conversion. This step is to get the existing values into a csv file, you may use the simple power shell command pated below to export the current data,

Get-Mailbox  -ResultSize 3000 | select UserPrincipalName,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota, MaxSendSize,MaxReceiveSize,RecipientLimits | Export-Csv C:\LimitDetails.csv

The output file will be like,

Limit-pic-1-link

Remove the file line starts with “#Type System…..” and save it in the drive C:\ with the same name.

Note - In my scenario total user is less than 3000, if you have more than 3000 users the -ResultSize can be mentioned accordigly.

Execute the below command after the completion of linked mailbox creation to set the reconnected mailbox limit as same as it was before the migration.

Import-Csv C:\LimitDetails.csv | ForEach-Object { Set-Mailbox -Identity $_.UserPrincipalName -IssueWarningQuota $_.IssueWarningQuota -ProhibitSendQuota $_.ProhibitSendQuota  -ProhibitSendReceiveQuota $_.ProhibitSendReceiveQuota -MaxSendSize $_.MaxSendSize -MaxReceiveSize $_.MaxReceiveSize -RecipientLimits $_.RecipientLimits}

This will bring your mailbox limit details back to the original limit which was there on the user properties before the migration.

Set the user Mailbox Features using script,

Now let’s look at the other area, some of the company does now open all features (Active sync, OWA, IMAP, POP3 etc.) to every email user. But, if we convert a user mailbox into linked mailbox most of the  features (that I have seen) will be enabled defaults and we need to manually set it back to the previous values. Use this piece of script if you have a csv file with previous values,

As mentioned in the previous section, mandatorily we need to take a user's feature export before the linked mailbox migration. You may use the below command,

Get-CASMailbox -ResultSize 3000 | select PrimarySmtpAddress,MAPIEnabled,ImapEnabled,PopEnabled,OWAEnabled,ActiveSyncEnabled | Export-Csv c:\UserFeatures.csv

Your input csv file(C:\UserFeatures.csv) will be like below,

UserFeatures

Now, copy the below code and save is as _SetFeatures.ps1 (save the script into a known directory, I saved it inside C:\MailboxMigration\E2K7-Scripts)

Import-Csv C:\UserFeatures.csv |foreach{
$OWAStatus = $_.OWAEnabled
$PopStatus = $_.PopEnabled
$ImapStatus = $_.ImapEnabled
if($OWAStatus -eq "FALSE"){Set-CASMailbox -Identity $_.PrimarySmtpAddress -OWAEnabled $false}
if($PopStatus -eq "FALSE"){Set-CASMailbox -Identity $_.PrimarySmtpAddress -PopEnabled $false}
if($ImapStatus -eq "FALSE"){Set-CASMailbox -Identity $_.PrimarySmtpAddress -ImapEnabled $false}
}

Go to Exchange 2007 PowerShell and navigate to the path where you haev saved the above script(_SetFeatures.ps1).

Run cmdlet Set-ExecutionPolicy RemoteSigned before you execute our custom script(see below).

Execute_Cmdlet

Hope this will help you to automate some part of your migration/mass activity.

-Praveen

AddThis Social Bookmark Button
Last Updated on Tuesday, 15 November 2011 23:32
 

Add comment


Security code
Refresh

Read In

ARCHIVES

VISITORS

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter

Online : 17
Your IP: 107.21.136.116
,

Follow Us