#Powershell script to move #Exchange 2010 Databases back to Perference 1


So if you paying attention and saw in my previous post, you can check the database ActivationPreference. [#Powershell script to check #Exchange 2010 Database Perference]

Well this script goes one step further and actually moves a database back to ActivationPreference #1 it is not on it!

Again, it’s another one liner

get-MailboxDatabase | Sort Name | FOREACH {$db=$_.Name; $xNow=$_.Server.Name ;$dbown=$_.ActivationPreference| Where {$_.Value -eq 1};  Write-Host $db “on” $xNow “Should be on” $dbOwn.Key -NoNewLine; If ( $xNow -ne $dbOwn.Key){Write-host ” WRONG” -ForegroundColor Red; Move-ActiveMailboxDatabase $db -ActivateOnServer $dbOwn.Key -confirm:$False}ELSE{Write-Host ” OK” -Foregroundcolor Green}}


#Powershell script to check #Exchange 2010 Database Perference


So we all should know about Exchange Server 2010 Database Availability Groups (DAG).  Now when you add server to a DAG you assign an ActivationPreference number to each server.

The ActivationPreference parameter value is used to break ties during the automatic database activation process when multiple passive mailbox database copies meet the same criteria for activating. When multiple database copies meet the same criteria for activation the copy assigned the lowest activation preference number will be activated. The value for ActivationPreference is a number equal to or greater than 1, where 1 is at the top of the preference order. The position number cannot be larger than the number of database copies of the mailbox database plus 1.

You would also know that Exchange handles the DAG and will failover databases to other servers in the DAG that have a database copy.

Now this is cool and works like a dream, but what if, as in my case, you actually want the database to be on a preferred server?

Well I knocked up this one liner to check it!

Get-MailboxDatabase | Sort Name | FOREACH {$db=$_.Name; $xNow=$_.Server.Name ;$dbown=$_.ActivationPreference| Where {$_.Value -eq 1};  Write-Host $db “on” $xNow “Should be on” $dbOwn.Key -NoNewLine; If ( $xNow -ne $dbOwn.Key){Write-host ” WRONG” -ForegroundColor Red; }ELSE{Write-Host ” OK” -Foregroundcolor Green}}

Enjoy .. let me know what you think

Patch Tuesday come to #Exchange – Microsoft Security Bulletin MS10-024

#Exchange2010  Vulnerabilities in Microsoft Exchange and Windows SMTP Service Could Allow Denial of Service (981832)


This security update resolves one publicly disclosed vulnerability and one privately reported vulnerability in Microsoft Exchange and Windows SMTP Service. The more severe of these vulnerabilities could allow denial of service if an attacker sent a specially crafted DNS response to a computer running the SMTP service. By default, the SMTP component is not installed on Windows Server 2003, Windows Server 2003 x64 Edition, or Windows XP Professional x64 Edition.

The security update addresses the vulnerabilities by correcting the manner in which SMTP parses MX records and the manner in which SMTP allocates memory for interpreting SMTP command responses.