Exchange 2010

ESEUtil to Defrag an Exchange 2010 Mailbox Database

A garden is a complex of aesthetic and plastic intentions; and the plant is, to a landscape artist, not only a plant – rare, unusual, ordinary or doomed to disappearance – but it is also a color, a shape, a volume or an arabesque in itself. – Roberto Burle Marx

 

 

How To use ESEUtil to Defrag an Exchange 2010 Mailbox Database

We start this process by first opening the Exchange Management Shell and navigate to the folder containing the database file.

We then dismount the database

[PS] E:MailboxAB>Dismount-Database <name of database>

We now run ESEUtil to defrag the file using the /d switch to defrag

[PS] E:MailboxAB>eseutil.exe /d .<database name>

When completed we mount the database again.

[PS] E:MailboxAB>Mount-Database <database name>

Please see the following screen cap for refrence

And as always be sure that you have a backup that you can use for recovery if something goes wrong during the defrag.

Enable POP3 in Exchange 2010

They say a picture is worth a thousand words — here is one for ya

Run this command to configure the POP3 service to start automatically.

Set-service msExchangePOP3 -startuptype automatic

Run this command to start the POP3 service.

Start-service -service msExchangePOP3

– jermal

Determining Free Space in an Exchange 2010 Mailbox Database

In Exchange 2010 you can see how big your mailbox databases are, and how much white space they have, by running the following command in the Exchange Management Shell.

[PS] C:>Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto

In screen-cap database AB is 64.76 GB in size but has 11.97 MB white space due to mail deleted. This is a nice clean server post migration.  As time goes on the white space will grow and the need to defrag will be required to free up unused space.  — this I will go into at in another post.

– jermal

Public Folders Not Replicating From Exchange 2007 to 2010

After a migration from Exchange Server 2007 to Exchange Server 2010 I encountered a problem with the replication of public folders. It seems they would not replicate regardless of what I attempted.  I spent sometime looking into this, and not wanting to HACK in a solution just to make it work.  I wanted it to work and work right. I am here now to share some simple steps to look into if you a similar issues with public folder replication.

History: The public folders in this origination was from a Exchange 2003, migrated to 2007 (issues along the way) and not being moved to Exchange 2010.

From what I have read that this is a know issue and seems to happen with Exchange organizations that have previously run versions of Exchange Server 2003 or below.

The Exchange Server 2010 Application Event Log will have this error:

The store driver couldn’t deliver the public folder replication message ” ” because the following error occurred: The Active Directory user wasn’t found. This is Application Event ID 1020

The cause of this error:
A legacy container in Active Directory for the Exchange 2003 (or earlier) in server objects.

Do not follow these steps if you still have Exchange 2003 or earlier versions running in your organization.

Launch ADSIEdit.msc and navigate to CN=Configuration <your domain>, CN=Services, CN=Microsoft Exchange, CN=<your org name>, CN=Administrative Groups, CN=<your legacy administrative group>, CN=Servers.

If you no longer operate any Exchange 2003 or earlier servers and the Servers container is empty then you can delete the container.

I was able to replicate the public folder hierarchy and content from Exchange Server 2007 to 2010 after doing this.  How awesome is that!

– Jermal

Old Error, Now New

It’s back again:

Source: MSExchangeIS
Error ID: 9646
Description: Mapi session “xxxx: /o=OrganizationName/
ou=AdministrativeGroupName/cn=Recipients/cn=UserName”
exceeded the maximum of 500 objects of type “objtFolder”.

Microsoft Exchange 2010 server logs the above message. While on the client end Outlook client doesn’t update folders automatically.

The number of server-side objects that are allowed by clients is limited to prevent a single client from the exhausting resources on the Exchange server.

To resolve this problem:

1. Open Registry Editor and navigate to:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesMSExchangeIS

2. Right click ParametersSystem and create New -> Key

3. Enter MaxObjsPerMapiSession and confirm creation of the new sub-key

4. Right click newly created key, create new DWORD value called objtFolder and give it a decimal value bigger than default 500.

5. Create another DWORD value called objtFolderView and give it the same value.

Find my Exchange 2010 version with the help of PowerShell

You have exchange running.  What’s this; Microsoft has released SP2.  Well what version am I running. The answer is simple to obtain with a quick little PowerShell fun you can have it in seconds.

First you will need to run the Exchange Management Shell. Once you have this running you will issue the following command:

Get-ExchangeServer | select name, admindisplayversion | ft -AutoSize

Create New Exchange 2010 Mailbox Database with PowerShell

Here is a short hot-to use the PowerShell to create a new exchange mailbox database. I recently learned how to do this when setting up databases for my new Exchange 2010 setup and again today I went over the steps. Today I will share them with you.

 

First you will need to run the Exchange Management Shell. Once you have this running you will issue the following command:

new-mailboxdatabase -name ‘database-1’ -server ‘EXCHANGE’ -edbfilepath ‘E:Mailboxdatabase-1database-1.edb’ -logFolderPath ‘F:Mailboxdatabase-1Logsdatabase-1_Logs’

After you have created your database its time to mount, this is also done in the Exchange Management Shell.  Simply type the following:

mount-database -identity ‘database-1’

If you go to the EMC, you will see that the new database has been made and now mounted.

Modify the number of simultaneous Remote/Local Move Request on Exchange 2010

By default Exchange 2010 just move 5 mailboxes simultaneously. To increase or decrees this it you have to change a configuration file for Mailbox Replication Service.

Open the file C:Program FilesMicrosoftExchange ServerV14BinMSExchangeMailboxReplication.exe.config;

Increase the values to a number of simultaneous active moves that you want.

These values are:

MaxActiveMovesPerSourceMDB, MaxActiveMovesPerTargetMDB, MaxActiveMovesPerSourceServer, MaxActiveMovesPerTargetServer, MaxTotalMovesPerMRS

<!– Mailbox Replication Service configuration

Setting Name – Default, MinValue, MaxValue

MaxRetries – 60, 0, 1000
MaxCleanupRetries – 5, 0, 100
RetryDelay – 00:00:30, 00:00:10, 00:30:00
MaxMoveHistoryLength – 2, 0, 100
MaxActiveMovesPerSourceMDB – 5, 0, 100
MaxActiveMovesPerTargetMDB – 2, 0, 100
MaxActiveMovesPerSourceServer – 50, 0, 1000
MaxActiveMovesPerTargetServer – 5, 0, 1000
MaxTotalMovesPerMRS – 100, 0, 1024
FullScanMoveJobsPollingPeriod – 00:10:00, 00:03:00, 1.00:00:00
MinimumTimeBeforePickingJobsFromSameDatabase – 00:00:04, 00:00:00, 01:00:00
ServerCountsNotOlderThan – 00:10:00, 00:00:00, 01:00:00
MRSAbandonedMoveJobDetectionTime – 01:00:00, 01:00:00, 12:00:00
BackoffIntervalForProxyConnectionLimitReached – 00:30:00, 00:00:30, 1.00:00:00
DataGuaranteeCheckPeriod – 00:00:10, 00:00:01, 02:00:00
DataGuaranteeTimeout = 00:30:00, 00:00:00, 12:00:00
DataGuaranteeLogRollDelay = 00:01:00, 00:00:00, 12:00:00
EnableDataGuaranteeCheck = false, false, true
DisableMrsProxyCompression = false, false, true
DisableMrsProxyBuffering = false, false, true
MinBatchSize = 100, 2, 1000
MinBatchSizeKB = 256, 16, 16384
–>

Save and close the file;
Restart the Microsoft Exchange Mailbox Replication service.

Exchange 2010 Outlook AD photo import/export

To export a photo from AD use the following command:

$a= Get-ADUser USERNAME -Properties thumbnailphoto
$a.thumbnailphoto | Set-Content c:pathphoto.jpg -Encoding byte

To search all users and export their attribute of jpegPhoto if you want to use them for thumbnailPhoto attribute, use the following script taken from here http://social.technet.microsoft.com/Forums/ar-SA/ITCG/thread/4a1c0537-493c-409f-8ed3-b0798ad9f768

$filter = ‘(&(objectCategory=Person)(objectClass=User))’
$root= New-Object System.DirectoryServices.DirectoryEntry(“LDAP://RootDSE“)
$searcher = New-Object System.DirectoryServices.DirectorySearcher $filter

# filter only users from a certain OU (Remove comment character to enable)
#$searcher.searchroot = [adsi]‘LDAP://OU=test,DC=domain,DC=com’

$searcher.findall()  | foreach {
$user = [adsi]$_.path
$sAMAccountName = $user.psbase.Properties[“samaccountname”]
$user.psbase.Properties[“jpegPhoto”] | set-content “c:adminpics$sAMAccountName.jpg” -Encoding byte
}

You can import the photos individually using one simple line:

Import-RecipientDataProperty -Identity “USERNAME” -Picture -FileData ([Byte[]]$(Get-Content -Path “E:USERPICTURE.JPG” -Encoding Byte -ReadCount 0))

To remove a photo use the following:

Set-Mailbox USERNAME -removepicture

Move mailbox in Exchange 2010 fails

When I was moving a mailbox from Exchange 2007 to Exchange 2010 I had mailbox moves which fail due to the “corrupt” limit being hit.

errorMessage: Message (size 11.00 MB ) exceeds the maximum allowed size for submission to the target mailbox. You can increase this limit by using the Set-Mailbox cmdlet in the Exchange Management Shell.

And while this can be fixed by doing the following:
Go to to user mailbox properties (in EX2010), then go to mail flow settings, then set Message Size Restriction properties and set both Sending and Receive message size to high value (99999).

Then go Move Request node again and resume the move request and it should work. Just remember to go back to the user mailbox setting again and set Message size restriction to its default value.

This is a per mailbox solution and doesn’t scale when moving many email boxes over in the migration process.

So before attempting any mailbox moves during a migration from 2007 to 2010, make sure you set the send receive limit to something larger, otherwise valid messages will be dropped as “corrupt” messages simply because they are over the size limit

Set the limit under global config -> hub transport -> global setting

– jermal