Wednesday, December 18, 2013

Exchange Database Defragmentation Process. Complete Explanation

Exchange Database Defragmentation process. Complete Explanation

What is database defragmentation?
Database defragmentation is procedure for restoring the white space which is available in mailbox database.
Data is stored in pages in contiguous order in exchange mailbox database and on regular basis mailbox database size keep increasing because many reasons for example adding mailboxes to the mailbox database right. In one fine day you may observe that disk space is very less and you want to reduce the database size. There are two options are available here, you to vacate the mailboxes which are available in respective database, this activity doesn’t required any down time. If you’re having free disk space on other drive you can do this activity with less challenges.
Suppose you do not have alternate drive to move mailboxes  in that case you have option called ‘database defragmentation’ this is nothing but arranging data pages in contiguous order in respective database by doing this process occupied white space will be released and you will gain free space on drive.
Let us see know how to calculate white space, execute the below command, you can see the white space in availableNewMailboxSpace column



Before starting defragmentation process ensure that mailbox database need to dismount and ensure you have enough free space available on any drive.
For example database size is 19.26GB  and white space size is 6.103GB to do this defragmentation of this database 19.26-6.1=13.5+1=14.5 GB free space required approximately 15GB free space required
Why this much free space required or equivalent free space required?
During the defragmentation process, exchange will create a temporary defrag file to arrange data in contagiously and once the defragmentation process completes then exchange will delete the original database copy and replaces this tempdefrag file to the original database location. No need worry on this process its automatic exchange will do this.
In case you already started the defragmentation process without checking the free space in that case what will happen?
If you already started the process without checking the free space or you do not have sufficient space don’t panic let it run the process, if no enough free space available then defragmentation process cancels and it will not cause any problem to your database.

You have free space on other drive but not in C drive?
In general we will initiate the defragmentation process and temp file location automatically chosen to C drive (C:\program files\Microsoft\Exchange Server\V14\Bin or anywhere in C). in case you do not have free space on C drive and you enough free space on another drive then use /t switch to save temp file in another drive. I will show you in below.



I need to do defragmentation of the database but I have no enough free space on C drive but I have free space on E drive.
Execute the command as shown below such as eseutil/d “F:\dumpster Database\DB\dumpster database.edb” /t “E:\tempde\tempdefrag.edb”
This will crete temp edb database in E drive, once process completed it will automatically replaces in original edb location

Hope you learned the exchange defragmentation process please feel free to revert if you have questions




Wednesday, November 20, 2013

What is Active Manager in Exchange 2010

What is Active Manager in Exchange 2010

Active manager works part of exchange replication service, basically active manager is a organizer, active manager decides which mailbox database is active and which database is passive in DAG or which mailbox database copy should be mounted and which mailbox database copy acts as healthy copy in DAG. This will be decided depending on the mailbox database activation preference number.

Let us know much more details on this Active manager, there are two roles in Active manager
Such as Primary Activation Manager (PAM) and Standby Activation Manager (SAM).

Both the roles monitors the health of the database from the information store level and from the ESE level however PAM  determines which database is active and which is passive.

SAM concentrates on health of the information store which is running on local server, if SAM detects failure of information store or database, it initiates communication with PAM for the database fail over.
Server that hosts PAM initiates the fail over. You may have a question if PAM server is down?
Or PAM server itself is offline then another server seizes the PAM role in DAG and initiates the fail over.  

PAM hosts in cluster quorum resource server, if cluster quorum server fails then PAM moves to where ever cluster quorum resource moves to another server in DAG  

Q:-Which Exchange server holds the SAM role?
A:-All the DAG members holds the SAM server role, responsible for monitoring the respective server databases from the information store level

Q:-Which Exchange server holds the role of PAM
A:-At any given point of time only one server can hold the PAM role in DAG. the server that contains cluster quorum information that server holds the PAM role.

Friday, November 1, 2013

Two node DAG maintenance during the power shutdown activity or electrical maintenance

Two node DAG maintenance during the power shutdown activity or electrical maintenance
We have to put the DAG member servers in maintenance mode during the datacenter maintenance or during the power shutdown activities or installing exchange updates/roll ups. Not necessary to put DAG members in maintenance mode for windows updates because windows updates is for operating system and not for exchange right, however if you feel you want put maintenance mode even in windows updates you can.
To bring the DAG member to the maintenance mode need not follow manual steps but certain planning is essentially required, let me explain you how to carry this activity
Assume that we have DAG configured in two node, now execute the below inbuilt script, you may have question what this command will do. This command makes few changes such as moves all the active database copies to the another DAG member, pause the cluster services and blocks the auto activation,
Now DAG member safe with passive mailbox database copies, this script basically stops all the communication with other DAG member server
During the execution as shown below you observe warning just be patience and ignore
.\StartDagServerMaintenance.ps1 –server ex2010a



After completing the above command check the database status by executing the below command



You can observe whichever the mailbox database moved ‘last inspected logs time stamp’





Now you can safely shutdown the DAG member (the server on which you executed the above script)
Once maintenance activity completed execute the below mentioned script to stop the maintenance



This will makes the server back to DAG communication after that you have to distribute the mailbox databases for that execute the below command
.\RedistributeActiveDatabases.ps1 –DagName DAG01 –BalanceDBsByActivationPreference –Confirm:$false   
Mailboxdatabases distributed across the two DAG members by referring the activation preference number
Brief summary
Shutdown servers in sequence
1. Mailbox server 01 which doesn’t hold any active database copies
2. Dismount the mailbox databases on server02 and shutdown
3. Shutdown the file share witness server (if you shutdown file share witness in before mailbox server then might endup with some issues because DAG will lose the quorum. If you made FS down but mailbox servers still ON then start FS wait for few minutes then shutdown mailbox server and then finally file share witness)
3. then shutdown HT,CAS and EDGE
Switching on the servers in sequence
1.Start File share witness server
2.start server02 and mount the databases
3.start HT CAS Edge servers
4.Observe mail flow by sending couple of mails and once everything settled distribute the mailboxdatabases as explained in earlier steps

Everything is possible keep learning J
If you feel this article helped leave your comments


Saturday, October 19, 2013

Failed and Suspended-Reseeding Mailbox Database in DAG Exchange 2010

When mailbox database copy failed in exchange 2010 DAG
it is necessary to reseed the mailbox server with failed copy

Open EMC and if your able to see failed database copy

Then first we need suspend the replication for the failed database copy

Use the following command to suspend replication

Step1:-Suspend-mailboxdatabaseCopy –identity “Sal it\seqmbx01”

After executing the above command ask for confirmation click Y for yes

Step2:-After executing the above command failed mailboxdatabase will change to ‘failed and suspended”
as shown in below snap


Step3:-Re seed the database now by executing the below command as below and also shown below snap  


Update-MailboxDatabaseCopy -Identity "Sal it\Seqmbx01" -DeleteExistingFiles



Now it will begin the process and depending the database size it will take some time to complete the process after completing this process active mailbox database will be mounted and passive copy will be Healthy 




















Thursday, October 17, 2013

Enable OWA from powershell





MapiExceptionNotFound error while moving the mailbox

Error: MapiExceptionNotFound: Unable to synchronize manifest. (hr=0x8004010f, ec=-2147221233)
Diagnostic context:
    Lid: 55847   EMSMDBPOOL.EcPoolSessionDoRpc called [length=239]
    Lid: 43559   EMSMDBPOOL.EcPoolSessionDoRpc returned [ec=0x0][length=503][latency=15]

This error will appear due to mailbox corruption to eliminate the above error need repair the mailbox 

execute the following shell command then clear the move request and initiate again move request  

New-MailboxRepairRequest -Mailbox userID -CorruptionType SearchFolder, AggregateCounts, ProvisionedFolder, FolderView

Members can't remove themselves from security groups. Please set the group to Closed for requests to leave

Members can't remove themselves from security groups. Please set the group to Closed for requests to leave

Answer:-if you try to modify the group membership or if you want to change any specific on particular distribution group the above error will appear.
In my case I have universal distribution group the user want to restrict that group for internal communication for this we need to enable ‘internal authentication required’ option in mailflow settings in group properties when I click this option getting error
“Members can’t remove themselves from security groups, please set the group to closed for requests to leave”
Execute the below shell command the above error disappears and then you can modify the group settings


Set-Distributiongroup –identity <DistributionGroupName> –MemberDepartRestriction Closed