Quantcast
Channel: Practical 365
Viewing all 530 articles
Browse latest View live

Exchange 2010 FAQ: Can You Automate Rebalancing a Database Availability Group?

$
0
0

Q: Is there a way to script Exchange 2010 Database Availability Groups so that mailbox databases automatically fail back to their preferred node?

A: In short, yes.

I’ve been asked whether there is a way to script or automate the failover (or more accurately, switchover) of the mailbox databases in an Exchange 2010 Database Availability Group.

The goal is to always return mailbox databases to their preferred node within the DAG after business hours, when something during the day has caused them to failover to different nodes.

Why would you want to do this? There could be several reasons:

  • to balance out the performance of each server by ensuring no one server is handling more databases than others
  • to return databases to the most well-connected locations relevant to the user population
  • to return databases to the correct DAG nodes for backups to run successfully and in a supported manner

So in order to do this you can use the RedistributeActiveDatabases.ps1 script provided by Microsoft in Exchange 2010 SP1 (and later) to rebalance databases in a DAG. See a demonstration of that script here. All you would need to do is run that script as a scheduled task using an account with the required Exchange administrative privileges.

However, if you have that script running every night as a scheduled task you face the possible situation where rebalancing the DAG is not a desirable outcome.

Consider that databases in a DAG may failover due to server hardware failure, such as a disk or memory within a server. Even though the server is up again, doesn’t necessarily mean that the memory fault is resolved, or that the disk isn’t running in a degraded state.

So how do you prevent an unhealthy server from hosting active mailbox databases if the rebalancing of the DAG is automated?

The solution is to block activation on the unhealthy server. There are two ways you can do this.

The first method is to use Set-MailboxServer with the -DatabasecopyAutoActivationPolicy parameter. For example here is  server with an unrestricted activation policy, so it is capable of activating passive databases.

[PS] C:\>Get-MailboxServer HO-EX2010-MB2 | ft name,databasecopy* -auto

Name          DatabaseCopyAutoActivationPolicy
----          --------------------------------
HO-EX2010-MB2                     Unrestricted

By setting the activation policy to “Blocked” the server will not activate any databases when the DAG is rebalanced.

[PS] C:\>Set-MailboxServer ho-ex2010-mb2 -DatabaseCopyAutoActivationPolicy Blocked

The second method is actually the same underlying technique, but adds a few more steps that are worth performing. If a server is unhealthy then it probably shouldn’t be hosting any active databases, so you also want to move any other active databases off the server as well.

You can achieve this by running the StartDagServerMaintenance.ps1, the same script used to manage installation of updates on DAG members.

[PS] C:\>cd $exscripts
[PS] C:\...>.\StartDagServerMaintenance.ps1 ho-ex2010-mb2

Either of those methods will prevent the DAG member from hosting active databases until you’ve had a chance to resolve the server health issue.


This article Exchange 2010 FAQ: Can You Automate Rebalancing a Database Availability Group? is © 2012 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com


PowerShell Script to Generate Email Traffic in a Test Lab Environment

$
0
0

For a long time now I’ve wanted to write a script that would automatically generate email traffic within an Exchange Server test lab environment.

Having realistic email traffic within a test lab environment means you can do such real world activities as:

  • test backup and recovery scenarios
  • learn how to use message tracking logs
  • test archiving solutions

In the past I’ve used some simple VBScripts that just sent random messages via SMTP as a way to fill up test lab mailboxes. That approach had some disadvantages though. The scripts I wrote only sent a stream of email messages at a single rate rather than at varying rates through the day as you would see in the real world. They also filled up inboxes only, never putting the messages in the Sent Items folder for the From address.

So last week I got to work creating a new PowerShell script to generate the email traffic. I tracked some of the development in the forums and can now share the complete script here.

This script does require some setting up before you run it, so please read the instructions to get it working in your test lab. I have only written and tested this script for Exchange 2010 training lab environments on the assumption that most people will be training for the latest version of Exchange.

Before we go further let me be absolutely clear that this script is for test lab environments only. Under no circumstances should you attempt to run this script in a production environment.

Using the Start-MailGen.ps1 Script in Your Test Lab

The scripts uses the Exchange Web Services Managed API so the first step is to download and install that on your test lab server.

EWS Managed API

EWS Managed API

Next, download the script and extract the three files to your server. I placed mine in C:\Scripts\MailGen.

Download the script file here: Start-MailGen.ps1 (downloaded 1274 times so far)

Open the Start-MailGen.ps1 file in the PowerShell editor or in Notepad and check the following items.

The $dllfolderpath variable is set to the default installation path for the EWS Managed API v1.1. If you install a different version, or to a different path, update this variable.

#Path to the Exchange Web Services DLL
$dllfolderpath = "C:\Program Files\Microsoft\Exchange\Web Services\1.1\Microsoft.Exchange.WebServices.dll"

The script uses a switch statement to determine how many emails to send each hour of the day. These values are what I use but you can change them up or down to suit your test lab. The hours 6am to 7pm are individually specified, and then the default value at the end is used for the remaining hours of the day.

06 {$sendcount = 50}
07 {$sendcount = 80}
08 {$sendcount = 600}
09 {$sendcount = 600}
10 {$sendcount = 800}
11 {$sendcount = 1000}
12 {$sendcount = 600}
13 {$sendcount = 600}
14 {$sendcount = 800}
15 {$sendcount = 800}
16 {$sendcount = 900}
17 {$sendcount = 400}
18 {$sendcount = 200}
19 {$sendcount = 80}
default {$sendcount = 10}

You can just specify even numbers like the above because the script varies the send count further by adding a random number each time. This will give you a realistic level of email traffic through the different hours of the day.

Sample email traffic graph

Sample email traffic graph

The service account that will be running the script needs impersonation rights granted to it. I run mine as Administrator since it is just a test lab. Open the Exchange Management Shell and run the following command to grant the impersonation rights.

[PS] C:\>New-ManagementRoleAssignment -Name:impersonationAssignmentName -Role:ApplicationImpersonation -User:administrator

You may also need to set your script execution policy to unrestricted.

[PS] C:\>Set-ExecutionPolicy Unrestricted

Also, as the script file was downloaded from the internet you may need to right-click the file and choose Properties, and then click the Unblock button.

The script also depends on the Active Directory remote administration tools. These should be installed already on an Exchange 2010 mailbox server, but if you’re running the script from a non-Exchange server you may need to install them.

Finally, to start generating email traffic open the Exchange Management Shell and run the script.

[PS] C:\Scripts\Mailgen>.\Start-MailGen.ps1

The script begins to send email and will show a progress indicator.

Start-MailGen.ps1 running

Start-MailGen.ps1 running

The script will select a random sender and recipient from the available mailboxes in your test lab environment, and then construct a random email message using the two files that are provided with the script.

After sending the applicable number of emails for that hour of the day the script will sleep for 5 minute blocks until it reaches the next hour, and will start sending again.

You can leave the script running for several days if you wish, or set it as a scheduled task to ensure that it starts up again if the server is rebooted.

How to Hard-Code the EWS URL

A few people have seen Autodiscover errors in their test lab and, if they have verified that Autodiscover is otherwise working fine, may need to look at hard-coding the EWS URL in the script. To do so find the following line and comment it out with the hash character:

#$service.AutodiscoverUrl($user.Properties.mail)

Now add a new line below it with the following:

$service.Url = "https://ho-ex2010-mb1.exchangeserverpro.net/EWS/Exchange.asmx"

Replace the URL above with the appropriate server FQDN for your own server environment.


This article PowerShell Script to Generate Email Traffic in a Test Lab Environment is © 2012 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Dealing with Exchange Server Update Rollups and Forefront Protection for Exchange

$
0
0

When Microsoft recently released the latest update rollup for Exchange Server 2010 a few disgruntled customers left comments about the situation with Exchange update rollups and Forefront Protection for Exchange.

If you’re not a Forefront user or you’re otherwise unaware of the situation, the issue is that Forefront Protection for Exchange and update rollups don’t play nicely together. For example during installation the update rollup can hang at stages such as restarting the Exchange services after the update has been applied.

Services not starting after Exchange Server rollup installation

Services not starting after Exchange Server rollup installation

This is why each update rollup release comes with the following instructions:

Note for Forefront Protection for Exchange users For those of you running Forefront Protection for Exchange, be sure you perform these important steps from the command line in the Forefront directory before and after this rollup’s installation process. Without these steps, Exchange services for Information Store and Transport will not start after you apply this update. Before installing the update, disable ForeFront by using this command: fscutility /disable. After installing the update, re-enable ForeFront by running fscutility /enable.

As a result we see comments like these from disgruntled customers.

Note for Forefront Protection for Exchange users: We still don’t care enough about you to add two lines to the setup script. Instead you have to do it manually. Or you can install the update via Microsoft Update and you’ll be in for a funny surprise.

Hey Microsoft…. could you not detect for your own software and automatically run the command fscutility /disable????, Now I cannot even get WUS to do this…. Annoyed! and feeling unappreciated as a FF customer

Microsoft actually has provided a solution for this, back when Exchange Server 2007 SP2 was released, and appears to have carried it forward for Exchange Server 2010 as well. A script named CustomPatchInstallerActions.ps1 can be used to perform pre- and post-installation tasks for update rollups.

I’m not sure why they don’t refer to it with each update rollup release, but as far as I can tell from my own testing it works fine.

Here is what you need to do.

  1. In the \Scripts folder of your Exchange 2010 installation find the file named CustomPatchInstallerActions.ps1.template
  2. Create a new sub-folder in \Scripts named Customizations
  3. Copy the script template into that sub-folder, and remove the .template extension
  4. Edit the file with the customizations you want, and the next time you install an update rollup the script will be called automatically

So what kind of customizations should you include? I did a little testing and here is what I suggest as a minimum. You’ll also find Microsoft’s advice here.

First, I ran fscutility /disable (from the C:\Program Files (x86)\Microsoft Forefront Protection for Exchange Server folder) to see what happens. I received the following output.

Error:
  Microsoft Forefront Protection cannot be disabled at this time.  Please stop
  the following services and then rerun this utility.

   FSCController
   MSExchangeTransport
   MSExchangeIS

So clearly some services need to be stopped first. That will need to go in the script.

After disabling those services fscutility /disable works successfully. So that can be run second.

  Removing dependencies...

      dependency on FSCController removed from Microsoft Exchange Information Store
      dependency on FSEIMC removed from Microsoft Exchange Transport Service
      Microsoft Exchange Transport Service Agent registration removed

Status:  Microsoft Forefront Protection NOT Integrated.

In the custom script itself the actions to perform before installing an update rollup go in the PrePatchInstallationActions function.

function PrePatchInstallActions
{
                Log "Running PrePatchInstallActions"

		Log "Stopping services"
		Stop-Service FSCController,MSExchangeTransport,MSExchangeIS -Force

		Log "Disabling Forefront"
		$fscutility = "C:\Program Files (x86)\Microsoft Forefront Protection for Exchange Server\fscutility.exe"
		Invoke-Expression $fscutility /disable

}

Notice I’ve also made use of the Log function that is in the script so that I can see in the log file later that my custom actions were run (or at least attempted to run). The log file is written to C:\ExchangeSetupLogs\CustomPatchInstallActions.log

After the update rollup is finished installing there is a similar process involved to re-enable Forefront. These steps go in the PostPatchInstallActions function.

function PostPatchInstallActions
{
                Log "Running PostPatchInstallActions"

		Log "Stopping services"
		Stop-Service FSCController,MSExchangeTransport,MSExchangeIS -Force

		Log "Enabling Forefront"
		$fscutility = "C:\Program Files (x86)\Microsoft Forefront Protection for Exchange Server\fscutility.exe"
		Invoke-Expression $fscutility /enable

		Log "Starting services"
		Start-Service FSCController,MSExchangeTransport,MSExchangeIS

}

When I upgraded two servers side-by-side, one with the CustomPatchInstallerActions.ps1 and one without, the one with the script updated without any problems and the one without hung while trying to start the services afterwards.

So in my testing this appears to work well, but it is something you should test in your own environment before relying on it too heavily.

Note that this script can be used for all kinds of situations even when Forefront is not installed. If you have any pre- or post-install actions required in your environment (eg running the StartDagServerMaintenance.ps1 script, disabling backups, disabling other antivirus software, sending an email alert to your team) you can include those in this CustomPatchInstallerActions.ps1 script.


This article Dealing with Exchange Server Update Rollups and Forefront Protection for Exchange is © 2012 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Create an Exchange Mail Flow Latency Heat Map with PowerShell

$
0
0

I was performing some mailbox server health checks recently and was trying to find an easy way to test mail flow latency between a lot of servers at once using Test-MailFlow.

After a little bit of tinkering I came up with a PowerShell script that would do the job, but the report it generated was a bit hard to read because all of the output was just on the screen in a single colour. So I decided to take it a step further and output the results to HTML and use colour-coded table cells to give me a report that is easier to read at a glance.

So I’m sharing the script with you here as well. Please be aware that I haven’t put a lot of coding effort into adding custom parameters, testing a wide variety of scenarios, or doing complex error handling. Also the script doesn’t troubleshoot for you, it only outputs a result that may indicate a problem for you.

Download the script file here: MailFlowHeatMap.ps1 (downloaded 1078 times so far)

How to Run the Script

The script has no parameters, you simply execute it from within PowerShell on a server or computer that has the Exchange 2010 management tools installed.

PS C:\>.\MailFlowHeatMap.ps1

You may need to right-click the downloaded file, open the Properties and unblock it. You may also need to set your PowerShell execution policy to allow unsigned scripts to run.

A small amount of output is written in the shell window to let you know that the script is making progress.

The result is a HTML file showing colour-coded table cells for the mailbox latency values (which are in seconds).

Customizing the Script

You can customize the heat map colours and the output file name by modifying these variables in the script itself (values are in seconds, cool and cold should be the same).

[int]$hot = 30
[int]$warm = 20
[int]$cool = 10
[int]$cold = 10
$filename = "mailflowheatmap.html"

If you’re looking to scheduled the script to run using Task Scheduler there is an example of how to do that here.

If you’d like to email the report to yourself there is example code here. You would just need to modify that example to use the $htmlreport in this script as the message body.

$message.Body = $htmlreport

Download the script file here: MailFlowHeatMap.ps1 (downloaded 1078 times so far)

If you have other questions please leave a comment below.


This article Create an Exchange Mail Flow Latency Heat Map with PowerShell is © 2012 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

PowerShell Tip: Get a List of the Top Exchange Server Mailboxes by Size

$
0
0

Reader Faisal asks about retrieving a list of the top 30 mailboxes in order of size.

Finding the top (or largest) mailboxes in the Exchange Server organization is a fairly common requirement. I’m often asked to produce such lists by managers when issues of server capacity get raised.

In fact, it is why I wrote the Get-MailboxReport.ps1 script, which I recommend you download.

But, in the interests of learning about PowerShell, let’s also take a look at doing it manually. Fortunately this is quite a simple report to generate using PowerShell.

You might already be familiar with the Get-MailboxStatistics cmdlet, for example:

[PS] C:\>Get-Mailbox Alan.Reid | Get-MailboxStatistics

DisplayName ItemCount StorageLimitStatus        LastLogonTime
----------- --------- ------------------        -------------
Alan Reid   608               BelowLimit 6/27/2012 5:11:15 AM

Get-MailboxStatistics returns an object made up of various properties that describe the mailbox statistics for the mailbox. We can take a closer look at these properties using Get-Member.

[PS] C:\>Get-Mailbox Alan.Reid | Get-MailboxStatistics | Get-Member

   TypeName: Microsoft.Exchange.Data.Mapi.MailboxStatistics

Name                    MemberType   Definition
----                    ----------   ----------
Clone                   Method       System.Object Clone()
Dispose                 Method       System.Void Dispose()
Equals                  Method       bool Equals(System.Object obj)
GetDisposeTracker       Method       Microsoft.Exchange.Diagnostics.DisposeTracker GetDisposeTracker()
GetHashCode             Method       int GetHashCode()
GetProperties           Method       System.Object[] GetProperties(System.Collections.Generic.ICollection[Microsoft....
GetType                 Method       type GetType()
SuppressDisposeTracker  Method       System.Void SuppressDisposeTracker()
ToString                Method       string ToString()
Validate                Method       Microsoft.Exchange.Data.ValidationError[] Validate()
PSComputerName          NoteProperty System.String PSComputerName=ho-ex2010-mb1.exchangeserverpro.net
RunspaceId              NoteProperty System.Guid RunspaceId=8da06b60-9483-4d24-9930-13567c0fd94e
AssociatedItemCount     Property     System.Nullable`1[[System.UInt32, mscorlib, Version=2.0.0.0, Culture=neutral, P...
Database                Property     Microsoft.Exchange.Data.ObjectId Database {get;}
DatabaseName            Property     System.String DatabaseName {get;}
DeletedItemCount        Property     System.Nullable`1[[System.UInt32, mscorlib, Version=2.0.0.0, Culture=neutral, P...
DisconnectDate          Property     System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral,...
DisconnectReason        Property     System.Nullable`1[[Microsoft.Exchange.Data.Mapi.MailboxState, Microsoft.Exchang...
DisplayName             Property     System.String DisplayName {get;}
Identity                Property     Microsoft.Exchange.Data.Mapi.MailboxId Identity {get;}
IsArchiveMailbox        Property     System.Nullable`1[[System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, ...
IsQuarantined           Property     System.Boolean IsQuarantined {get;}
IsValid                 Property     System.Boolean IsValid {get;}
ItemCount               Property     System.Nullable`1[[System.UInt32, mscorlib, Version=2.0.0.0, Culture=neutral, P...
LastLoggedOnUserAccount Property     System.String LastLoggedOnUserAccount {get;}
LastLogoffTime          Property     System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral,...
LastLogonTime           Property     System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral,...
LegacyDN                Property     System.String LegacyDN {get;}
MailboxGuid             Property     System.Guid MailboxGuid {get;}
MailboxTableIdentifier  Property     System.String MailboxTableIdentifier {get;}
MapiIdentity            Property     Microsoft.Exchange.Data.Mapi.MapiObjectId MapiIdentity {get;}
MoveHistory             Property     System.Object MoveHistory {get;}
ObjectClass             Property     Microsoft.Exchange.Data.Mapi.ObjectClass ObjectClass {get;}
OriginatingServer       Property     Microsoft.Exchange.Data.Fqdn OriginatingServer {get;}
ServerName              Property     System.String ServerName {get;}
StorageLimitStatus      Property     System.Nullable`1[[Microsoft.Exchange.Data.Mapi.StorageLimitStatus, Microsoft.E...
TotalDeletedItemSize    Property     Microsoft.Exchange.Data.Unlimited`1[[Microsoft.Exchange.Data.ByteQuantifiedSize...
TotalItemSize           Property     Microsoft.Exchange.Data.Unlimited`1[[Microsoft.Exchange.Data.ByteQuantifiedSize...

Of particular interest if we want to find the largest mailboxes is the TotalItemSize property. We can sort on that property using Sort-Object, and then use Select-Object to only return the top X number of results.

As a one-liner this breaks down as follows:

  • A Get-Mailbox or Get-MailboxDatabase depending on the scope of our investigation
  • The output from either of the above cmdlets piped into Get-MailboxStatistics
  • The output from Get-MailboxStatistics piped into Sort-Object
  • Select-Object to return only the desired number of results, and optionally to return only the specific properties we want to see in our final output
  • Optionally again, an export to file

Example #1 - Select top 30 mailboxes by totalitemsize

[PS] C:\>Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize -First 30

DisplayName                                                 TotalItemSize
-----------                                                 -------------
Administrator                                               3.495 MB (3,665,004 bytes)
Alan Reid                                                   2.893 MB (3,033,472 bytes)
TestMB HO                                                   1.818 MB (1,906,318 bytes)
Help Desk                                                   1.795 MB (1,882,379 bytes)
Test Mailboxey                                              1.659 MB (1,739,954 bytes)
TestMB BR                                                   1.657 MB (1,737,479 bytes)
Alannah Shaw                                                1.291 MB (1,353,920 bytes)
Diane Hall                                                  1.278 MB (1,339,655 bytes)
Melanie Thomas                                              1.235 MB (1,294,958 bytes)
Charlotte Bonsey                                            1.233 MB (1,293,409 bytes)
Chris Majumdar                                              1.218 MB (1,277,482 bytes)
Caroline Ball                                               1.213 MB (1,271,477 bytes)
Jane Martin                                                 1.206 MB (1,264,527 bytes)
Ferzana King                                                1.206 MB (1,264,310 bytes)
Hilary Greenall                                             1.192 MB (1,250,258 bytes)
Alex Heyne                                                  1.185 MB (1,242,700 bytes)
Sue Chandarana                                              1.177 MB (1,234,595 bytes)
Ana Williams                                                1.174 MB (1,231,015 bytes)
Hasu Janjuh                                                 1.173 MB (1,229,980 bytes)
Davina Nsiah                                                1.169 MB (1,225,418 bytes)
Valerie Andrews                                             1.168 MB (1,224,599 bytes)
Michael Phillips                                            1.167 MB (1,223,914 bytes)
Bob Winder                                                  1.166 MB (1,222,496 bytes)
Sandra Watson                                               1.164 MB (1,220,810 bytes)
Michelle Stevenson                                          1.164 MB (1,220,166 bytes)
Andrea Sharma                                               1.163 MB (1,219,437 bytes)
Hilary Seaman                                               1.161 MB (1,217,606 bytes)
Joy Singh                                                   1.16 MB (1,216,872 bytes)
Yvonne Bardall                                              1.154 MB (1,210,163 bytes)
Sue Andress                                                 1.153 MB (1,209,401 bytes)

Example #2 – Select top 100 mailboxes by totalitemsize and export to CSV file

[PS] C:\>Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize -First 100 | Export-CSV top100mailboxes.csv

The resulting CSV file:

Hopefully that answers your question Faisal, but once again you’re welcome to download and use the Get-MailboxReport.ps1 script for this type of mailbox size reporting.


This article PowerShell Tip: Get a List of the Top Exchange Server Mailboxes by Size is © 2012 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Test-ExchangeServerHealth – PowerShell Script to Generate a Health Check Report for Exchange Server 2010

$
0
0

Updated: 5/5/2013 with multiple bug fixes and to include the DAG health check.

This PowerShell script will perform a health check of your Exchange Server environment, including servers and database availability groups, and output a HTML report that you can send to an email address.

Before you run the script please read the guidance below, and check the known bugs and FAQ at the end of this article for current issues.

Download the script file here: Test-ExchangeServerHealth.ps1 (downloaded 10973 times so far)

The Test-ExchangeServerHealth.ps1 script is run from the Exchange Management Shell. You can use a few builtin parameters to control what it does.

.PARAMETER Server
Perform a health check of a single server

.PARAMETER ReportMode
Set to $true to generate a HTML report. A default file name is used if none is specified.

.PARAMETER ReportFile
Allows you to specify a different HTML report file name than the default. Implies -ReportMode

.PARAMETER SendEmail
Sends the HTML report via email using the SMTP configuration within the script. Implies -ReportMode

If you use the report mode you’ll get a HTML file containing the health check results, and/or an email to your designated address if you also use the send email option.

For the email functionality to work please update these variables in the script to suit your environment. Please note this has changed since v1.1 so please do not simply paste your customizations from previous versions of the script.

#...................................
# Modify these Email Settings
#...................................

$smtpsettings = @{
	To =  "administrator@exchangeserverpro.net"
	From = "exchangeserver@exchangeserverpro.net"
	Subject = "Exchange Server Health Report - $now"
	SmtpServer = "smtp.exchangeserverpro.net"
	}

Download the script file here: Test-ExchangeServerHealth.ps1 (downloaded 10973 times so far)

Please feel free to download and try the script. If you encounter any bugs or have any feedback please leave a comment below. I will do my best to answer each question and deal with any bugs that can be reproduced.

If you’re looking for an example of how to schedule the script to run using Task Scheduler please see this article.

My scheduled task settings for this script are:

  • Run whether user is logged on or not
  • Run with highest privileges
  • Action: Start a program
    • Program: powershell.exe
    • Arguments: -command “C:\Scripts\ExchangeServerHealth\Test-ExchangeServerHealth.ps1 -reportmode -sendemail”

Change Log:

  • V1.0, 5/07/2012 – Initial version
  • V1.1, 5/08/2012 – Minor bug fixes and removed Edge Tranport checks
  • V1.0, 5/05/2013 – A lot of bug fixes, updated SMTP to use Send-MailMessage, added DAG health check.

Bugs list and FAQ

Q: Which version of PowerShell is required?

Version 2.0 or higher. If you are running the script on a server that has Exchange 2010 roles or management tools installed then it will have v2.0. If you are running on an Exchange 2007 server check first whether v2.0 is installed. I don’t test the script on v1.0 but you are welcome to modify it as necessary to get it running on a v1.0 environment.

Q: Why do I get an error when the script sends the email report?

Make sure you’ve configured the email settings section of the script to point to a Hub Transport that either accepts anonymous users (typically an internet-facing Hub Transport), or if you’re using a separate management server or admin workstation point the SMTP server to a Hub Transport that has a receive connector set up that the server you’re running the script on is allowed to relay through.

Q: Why is there an error when the script checks the queue for Exchange 2007 Hub Transport servers?

This is a bug that I am working on. The script was not originally intended to be backwards compatible but I will do my best to fix this bug. This should be fixed now in v1.2.

Q: Why do I get errors when the script checks my Edge Transport servers?

Between firewalls and permissions the Edge Transport checks are difficult to account for so in the next version the Edge Transport role will simply be skipped by the script.

Q: Why do I get an error on the server uptime check?

This is a bug that I am working to reproduce and eliminate.

Q: What should I do when the script report an error/fail on my servers?

The script doesn’t perform any diagnostics when it detects an error, it only reports them to you. When you see an error you should investigate further using the management tools and cmdlets that are provided by Exchange.

If you are encountering situations where the script reports errors that turn out to be false alarms please let me know and I will do my best eliminate those false alarms.

Q: Can you add feature X to the script?

Currently I am working on the following feature improvements:

  • Exchange 2013 compatibility
  • CAS health/connectivity checks
  • Ability to specify a file name containing a static list of servers to check
  • General code cleanup, better verbose output, and a diagnostic log
  • A troubleshooting guide for investigating the issues the script reports in your environment

If you have other health check related features you’d like to see included please let me know in the comments below.


This article Test-ExchangeServerHealth – PowerShell Script to Generate a Health Check Report for Exchange Server 2010 is © 2012 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Exploring a New Exchange Server Environment

$
0
0

I was recently asked to provide my recommendations for what to look for when you encounter an unfamiliar Exchange Server organization, for example when changing jobs to a new employer.

This is an exercise that I am currently going through myself, so this article will probably be updated over time as I think of new items to add. In fact, if you have any suggestions of your own please feel free to leave a comment below.

Exchange Environment Overview

One of the best ways I know to get a quick overview of an Exchange Server organization is to run Exchange MVP Steve Goodman’s Exchange Environment Report script.

Exchange Environment Report

Exchange Environment Report

A word of warning – the script runs fine for me in small to medium organizations, but I once ran it in an organization with about 100,000 mailboxes and the powershell.exe process consumed over 8Gb of memory on the system I was running the script from. So if you’re running this in a very large environment I recommend using an admin workstation or server for the task, not a production Exchange server.

Mailbox Size Report

I also like to dump out a list of all of the mailboxes in the organization. For this task I use my Get-MailboxReport.ps1 script, and then open the resulting CSV file in Excel and use filters and sorting to explore the data.

Usually I’m looking to get a sense of general mailbox sizes, possible VIPs, the number of stale or disabled accounts, and any exceptional items such as very large mailboxes (e.g. in an organization with an average mailbox size of 2Gb you may discover a few +50Gb mailboxes).

Message Size Limits

There are plenty of places within Exchange where size limits can be set, so I just take a look at a few of the important ones to begin with.

Organization message size limits:

[PS] C:\>Get-TransportConfig | Select-Object MaxReceiveSize,MaxSendSize | fl

MaxReceiveSize : 10 MB (10,485,760 bytes)
MaxSendSize    : 10 MB (10,485,760 bytes)

Send Connector message size limits:

[PS] C:\>Get-SendConnector | Select-Object Name,MaxMessageSize

Name                                                        MaxMessageSize
----                                                        --------------
EdgeSync - HeadOffice to Internet                           10 MB (10,485,760 bytes)
EdgeSync - Inbound to HeadOffice                            unlimited
exchangebootcamp.com                                        10 MB (10,485,760 bytes)
winserverpro.net                                            10 MB (10,485,760 bytes)
exchange2013demo.com                                        10 MB (10,485,760 bytes)

Receive Connector message size limits:

[PS] C:\>Get-ReceiveConnector | Select Server,Name,MaxMessageSize

Server        Name                  MaxMessageSize
------        ----                  --------------
BR-EX2010-MB  Default BR-EX2010-MB  10 MB (10,485,760 bytes)
BR-EX2010-MB  Client BR-EX2010-MB   10 MB (10,485,760 bytes)
HO-EX2010-MB2 Default HO-EX2010-MB2 10 MB (10,485,760 bytes)
HO-EX2010-MB2 Client HO-EX2010-MB2  10 MB (10,485,760 bytes)
HO-EX2010-MB1 Default HO-EX2010-MB1 10 MB (10,485,760 bytes)
HO-EX2010-MB1 Client HO-EX2010-MB1  10 MB (10,485,760 bytes)
HO-EX2007-MB1 Default HO-EX2007-MB1 10 MB (10,485,760 bytes)
HO-EX2007-MB1 Client HO-EX2007-MB1  10 MB (10,485,760 bytes)
HO-EX2010-MB1 Relay                 10 MB (10,485,760 bytes)

Storage Quotas

The mailbox storage quotas are interesting as well.

[PS] C:\>Get-MailboxDatabase -IncludePreExchange2010 | Select Name,ProhibitSend*,IssueWarning*

Name                          ProhibitSendReceiveQuota      ProhibitSendQuota             IssueWarningQuota
----                          ------------------------      -----------------             -----------------
MB-HO-01                      4.3 GB (4,617,090,048 bytes)  4 GB (4,294,967,296 bytes)    3.7 GB (3,972,845,568 bytes)
MB-HO-02                      4.3 GB (4,617,090,048 bytes)  4 GB (4,294,967,296 bytes)    3.7 GB (3,972,845,568 bytes)
MB-BR-01                      4.3 GB (4,617,090,048 bytes)  4 GB (4,294,967,296 bytes)    3.7 GB (3,972,845,568 bytes)
MB-HO-03                      4.3 GB (4,617,090,048 bytes)  4 GB (4,294,967,296 bytes)    3.7 GB (3,972,845,568 bytes)
Mailbox Database              2.3 GB (2,469,396,480 bytes)  2 GB (2,147,483,648 bytes)    1.899 GB (2,039,480,320 by...
MB-HO-Archive                 2.3 GB (2,469,396,480 bytes)  2 GB (2,147,483,648 bytes)    1.899 GB (2,039,480,320 by...

It is also worth having a look for any mailboxes without storage quotas.

Mail Routing Topology

I’ve already mentioned Send Connectors and Receive Connectors with regards to their message size limits. But is also pays to take a look in more detail, especially at Send Connectors, to determine what the mail flow in and out of the organization looks like. This will let you discover whether there are any non-Exchange systems involved, such an an on-premise smart host or a hosted anti-spam service.

You can also check your MX records using the tools at MXToolbox.

Exchange Database Backups

Whether you are also responsible for backups or someone else has that responsibility I always implement the Get-DailyBackupAlerts.ps1 script to check the Exchange databases each morning and alert me if any of the backups are not running for them.

Logging Configurations

I like to check the logging configurations to make sure that in the event of a problem with email delivery I the right logs available for troubleshooting:

Traffic Statistics

Speaking of good uses of log data, I also like to run a few Log Parser queries on the servers to get an idea of the typical email traffic running through the environment.

Additional Items

Here are a few other items I also take a quick look at:

  • Room and Equipment mailboxes
  • Public Folder usage
  • Client versions
  • Remote access methods (OWA, ActiveSync, Outlook Anywhere)
  • Applications or devices using Exchange for SMTP relay
  • DNS records (e.g. SMTP alias, public names for OWA etc)
  • SSL certificates, particularly expiry dates
  • Exchange Best Practices Analyzer report

This article Exploring a New Exchange Server Environment is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Get-DAGHealth.ps1 – Database Availability Group Health Check Script

$
0
0

Since I released the Test-ExchangeServerHealth.ps1 script one of the most common feature requests has been to add health checks for Database Availability Groups.

So today I am pleased to announce the availability of v1.0 of Get-DAGHealth.ps1, a Database Availability Group health check PowerShell script.

This is the first release to your feedback and bug reports are welcome in the comments below. I hope to eventually merge this with the Test-ExchangeServerHealth.ps1 script to provide a single, daily health check script that you can use for your Exchange environments.

Please read the usage instructions in below or in the script help info.

Download the script file here: Get-DAGHealth.ps1 (downloaded 2383 times so far)

Running Get-DAGHealth.ps1

The script is written and tested for Exchange Server 2010 and Exchange Server 2013 CU1.

The script requires the Exchange Management Tools to run. You can execute it from the Exchange Management Shell, or a regular PowerShell session and it will add the Exchange snapin if not already loaded.

You can also execute it as a scheduled task. I use the follow settings in my scheduled task to make it work:

  • Run whether user is logged on or not
  • Run with highest privileges
  • Action:
    • Start a program: powershell.exe
    • Arguments: -command “c:\scripts\daghealth\get-daghealth.ps1 -Detailed -SendEmail”
  • You may need to modify your script execution policy to run this script as it is not signed
  • You may need to open the Properties of the downloaded file and “unblock” it before it will run

Use Get-Help to see more usage details and examples.

PS C:\Scripts\DAGHealth> get-help .\Get-DAGHealth.ps1 -Examples

NAME
    C:\Scripts\DAGHealth\Get-DAGHealth.ps1

SYNOPSIS
    Get-DAGHealth.ps1 - Exchange Server 2010 Database Availability Group Health Check Script.

    -------------------------- EXAMPLE 1 --------------------------

    C:\PS>.\Get-DAGHealth.ps1

    Checks all DAGs in the organization and outputs a health summary to the PowerShell window.

    -------------------------- EXAMPLE 2 --------------------------

    C:\PS>.\Get-DAGHealth.ps1 -Detailed

    Checks all DAGs in the organization and outputs a detailed health report to the PowerShell
    window. Due to the amount of detail the full report may get cut off in your window. I recommend
    detailed reports be output to HTML file or email instead.

    -------------------------- EXAMPLE 3 --------------------------

    C:\PS>.\Get-DAGHealth.ps1 -Detailed -SendEmail

    Checks all DAGs in the organization and outputs a detailed health report via email using
    the SMTP settings you configure in the script.

I generally recommend using the HTML file or email output to get the best results. The HTML output gives a color-coded health report to bring to your attention any potential health issues such as databases not active on their first preference server, unhealthy copies or queues, unhealthy content indexes, and other things that can sometimes go unnoticed with DAGs.

get-daghealth-output

The report is indicative only. You should investigate and validate any issues that it flags to determine what if any action is required to resolve them.

Download the script file here: Get-DAGHealth.ps1 (downloaded 2383 times so far)

Change Log:

  • V1.0 – 14/02/2013 – Initial release
  • V1.1 – 24/04/2013 – Bug fixes, Exchange 2013 compatibility

Feedback and bug reports welcome in the comments below. If you like this script please feel free to share this article with your friends and colleagues on Twitter, Facebook, LinkedIn, Google+ etc. You might also be interested in some of my other PowerShell scripts.


This article Get-DAGHealth.ps1 – Database Availability Group Health Check Script is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com


V1.1 of Get-DAGHealth.ps1 is Available

$
0
0

I’ve just updated the Get-DAGHealth.ps1 PowerShell script to version 1.1. The new version fixes some bugs with how the replication queues for lagged copies are handled, which seemed to be causing incorrect report results.

As an additional update I am pleased to announce that the script is now tested and working for Exchange Server 2013 database availability groups as well. I have not yet tested a mixed 2010/2013 org though.

You can download the new version here.

Please continue to report bugs and make feature requests in the comments on that post.


This article V1.1 of Get-DAGHealth.ps1 is Available is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Test-ExchangeServerHealth.ps1 v1.2 Released

$
0
0

I have just uploaded version 1.2 of the Test-ExchangeServerHealth.ps1 script.

This version includes a number of important bug fixes, as well as adding the DAG health check (from Get-DAGHealth.ps1).

You can download the new version here.

Please continue to report bugs and make feature requests in the comments on that post.


This article Test-ExchangeServerHealth.ps1 v1.2 Released is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

How to Reseed a Failed Database Copy in Exchange Server 2013

$
0
0

When you’re running an Exchange 2013 database availability group you will eventually need to deal with a failed database copy that needs to be reseeded.

Database copies may be in a failed state due to a variety of reasons, such as a hardware failure on the underlying storage system. After resolving the root cause of a failed database copy you then need to reseed the copy, which is a process that creates a new copy of the database by replicating the data from another DAG member that hosts a healthy copy.

To demonstrate how to reseed a failed database copy I’ve first caused a failure of one of my databases, which can be seen here in the output of the Get-MailboxDatabaseCopyStatus cmdlet.

[PS] C:\>Get-MailboxDatabaseCopyStatus *

Name                      Status
----                      ------
Mailbox Database 1\E15MB1 Healthy
Mailbox Database 2\E15MB1 FailedAndSuspended
Mailbox Database 1\E15MB2 Mounted
Mailbox Database 2\E15MB2 Mounted

If you’re looking for guidance to resolve failed content indexes in your database availability group, see PowerShell Tip: Fix All Failed Exchange Database Content Indexes.

The reseed operation can be started using either the Exchange Admin Center or the Exchange Management Shell (PowerShell).

Preparing to Reseed a Database Copy

There are a number of considerations when reseeding a database copy.

First, the time required for the reseed to complete will depend on the size of the database and the network performance between the source and destination servers.

By default the reseed will use the DAG member hosting the active database copy as the source.

If the database is 500Gb in size, that is 500Gb of database that needs to be copied across the network, plus the transaction log files and the content index for that database. This can add up to a lot of data that needs to travel across your network.

If the DAG members exist only within a single site connected by high speed LAN then this will not likely be a concern.

exchange-2013-reseed-from-active

However if the DAG members exist in multiple sites across a WAN then it may be more of an issue.

Fortunately, you can specify a source server for the database reseed, which allows you to select a server that has better connectivity to reseed from, such as another DAG member within the same site as the server with the failed database copy.

exchange-2013-reseed-from-passive

The options for selecting a reseed source will be demonstrated below.

Reseeding a Database Copy Using the Exchange Admin Center

Open the Exchange Admin Center and navigate to Servers -> Databases. Select the database that has the failed copy.

exchange-2013-reseed-failed-database-copy-01

On the database copy that is shown as failed click the Update link.

exchange-2013-reseed-failed-database-copy-02

You can click Browse and specify a source server if necessary, otherwise click Save to reseed from the server that hosts the active database copy.

exchange-2013-reseed-failed-database-copy-03

Wait for the reseed operation to complete.

exchange-2013-reseed-failed-database-copy-04

When the reseed operation has finished the database copy should now be healthy.

Reseeding a Database Copy using the Exchange Management Shell

We can also perform reseeds using the Update-MailboxDatabaseCopy cmdlet.

The database to reseed is entered in the format “Database Name\Server Name”, for example:

[PS] C:\>Update-MailboxDatabaseCopy "Mailbox Database 2\E15MB1"

To specify a source server for the reseed use the -SourceServer parameter as well.

[PS] C:\>Update-MailboxDatabaseCopy "Mailbox Database 2\E15MB1" -SourceServer EXMB3

If you receive an error message that log files already exist in the transaction log path for the database you can use the -DeleteExistingFiles parameter to tell the Exchange server to remove those files before beginning the reseed.

[PS] C:\>Update-MailboxDatabaseCopy "Mailbox Database 2\E15MB1" -DeleteExistingFiles

Finally, for long reseeds where you do not want to leave your Exchange Management Shell open, or when scripting a reseed and you don’t want the script to have to wait for the reseed to complete, you can use the -BeginSeed parameter.

[PS] C:\>Update-MailboxDatabaseCopy "Mailbox Database 2\E15MB1" -BeginSeed

Of course those parameters can be used in conjunction with each other, for example:

[PS] C:\>Update-MailboxDatabaseCopy "Mailbox Database 2\E15MB1" -DeleteExistingFiles -BeginSeed -SourceServer E15MB3

Monitoring Database Copy Health

If you do not already have a monitoring solution in place for your Exchange 2013 DAG I encourage you to try my Get-DAGHealth.ps1 or Test-ExchangeServerHealth.ps1 scripts.


This article How to Reseed a Failed Database Copy in Exchange Server 2013 is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Test-ExchangeServerHealth.ps1 v1.04 Released

$
0
0

I’ve just uploaded v1.04 of the Test-ExchangeServerHealth.ps1 script.

A quick note on versions – if you have v1.2 or v1.3 now then this version is *newer*. For a variety of reasons I have had to adjust the version numbering for these scripts.

Updates in version 1.04:

  • Added Exchange 2013 compatibility
  • Added option to output a log file
  • Converted many sections of code to use pre-defined strings
  • Fixed -AlertsOnly parameter
  • Improved summary sections of report to be more readable and include DAG summary

Here is an example of the improved health summary section in the report.

powershell-script-health-check-exchange

14097 downloads so far.
This script is available for download by Exchange Server Pro Insiders. Join here it’s free.


This article Test-ExchangeServerHealth.ps1 v1.04 Released is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Exchange 2013 Test-Mailflow Error for Remote Mailbox Servers

$
0
0

Following on from my last post about errors when running Test-ServiceHealth for Exchange 2013 Client Access servers, here is another PowerShell test cmdlet that behaves unexpectedly in Exchange 2013.

Test-Mailflow, as the name suggests, is used to test mail flow for Mailbox servers. The TechNet page provides the following example syntax:

Test-Mailflow Mailbox1 -TargetMailboxServer Mailbox2

What isn’t documented is the error that occurs if you try to run that command when your PowerShell session is connected to a server other than “Mailbox1″.

[PS] C:\scripts>Test-Mailflow E15MB1 -TargetMailboxServer E15MB2

[Microsoft.Mapi.MapiExceptionSendAsDenied]: MapiExceptionSendAsDenied:
Unable to submit message. (hr=0x80070005,ec=1244)

This error did not occur in Exchange 2010 under the same conditions.

As with the Test-ServiceHealth issues from my last post this situation is frustrating for me because I use Test-Mailflow in my Test-ExchangeServerHealth.ps1 script. So I needed to find a way to still perform the test while avoiding the error.

The solution was found by using PowerShell remoting. I’ve written this proof of concept code to demonstrate how remoting can be used to get a result for Test-Mailflow.

Note this is demo code only and is not intended to be a functional script. I will be incorporating this code into Test-ExchangeServerHealth.ps1 in the near future.

#Proof of concept code to test mail
#flow on remote E15 servers

[CmdletBinding()]
param (
	[Parameter( Mandatory=$false)]
	[string]$Server
)

Write-Verbose "Creating PSSession for $server"
try
{
    $url = (Get-PowerShellVirtualDirectory -Server $server | Where {$_.Name -eq "Powershell (Default Web Site)"}).InternalURL.AbsoluteUri
    $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $url -ErrorAction STOP
}
catch
{
    Write-Verbose "Something went wrong"
    Write-Warning $_.Exception.Message
    EXIT
}
    

try
{
    Write-Verbose "Running mail flow test on $Server"
    $result = Invoke-Command -Session $session {Test-Mailflow} -ErrorAction STOP
    $testresult = $result.TestMailflowResult

}
catch
{
    Write-Verbose "An error occurred"
    Write-Warning $_.Exception.Message
    EXIT
}

Write-Host "Mail flow test: $testresult"

Write-Verbose "Removing PSSession"

Remove-PSSession $session.Id

Here is an example of the output.

[PS] C:\scripts>.\Test-E15MailFlow.ps1 E15MB1
Mail flow test: Success


[PS] C:\scripts>.\Test-E15MailFlow.ps1 E15MB2 -Verbose
VERBOSE: Creating PSSession for E15MB2
VERBOSE: Running mail flow test on E15MB2
Mail flow test: Success
VERBOSE: Removing PSSession

This article Exchange 2013 Test-Mailflow Error for Remote Mailbox Servers is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Get-MailboxReport.ps1 v1.02 Released

$
0
0

Almost 30,000 downloads later it is time for an update to the Get-MailboxReport.ps1 script. Most of the changes are in response to feedback I’ve received since the release of the script.

Changes in v1.02 include:

  • re-ordered some report fields
  • added OrganizationalUnit field
  • added PrimarySMTPAddress field
  • added Inbox, Sent Items, and Deleted Items folder sizes
  • added archive mailbox stats (for Exchange native archiving)
  • updated Server field to Server/DAG

 

30612 downloads so far.
This script is available for download by Exchange Server Pro Insiders. Join here it’s free.


This article Get-MailboxReport.ps1 v1.02 Released is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Test-ExchangeServerHealth.ps1 v1.06 is Now Available

$
0
0

I’m please to announce the availability of v1.06 of the Test-ExchangeServerHealth.ps1 script.

The two most significant updates in version 1.06:

  • Fixed an uptime calculation bug for some regional settings.
  • Added localization strings to fix service health check errors for non-English systems.

The fixes for both of those issues have been a long time coming and I appreciate everyone who helped me fix them by providing me with extra details about their servers, and those who tested beta versions of the script and gave feedback.

Also included in version 1.06:

  • Added workaround for Test-Mailflow error for Exchange 2013 Mailbox servers.
  • Excluded recovery databases from active database calculation.
  • Fixed bug where high transport queues would not count as an alert.
  • Fixed error thrown when Site attribute can’t be found for Exchange 2003 servers.
  • Fixed bug causing Exchange 2003 servers to be added to the report twice.

 

20651 downloads so far.
This script is available for download by Exchange Server Pro Insiders. Join here it’s free.


This article Test-ExchangeServerHealth.ps1 v1.06 is Now Available is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com


Cannot Activate Database Copy: Content Index Catalog Files in Failed State

$
0
0

When activating a database copy in an Exchange Server 2010 Database Availability Group it may fail with an error message that catalog index files are in a failed state.

exchange-2010-cannot-activate-database

——————————————————–
Microsoft Exchange Error
——————————————————–
Cannot activate database copy ‘Activate Database Copy…’.

Activate Database Copy…
Failed
Error:
An Active Manager operation failed. Error The database action failed. Error: An error occurred while trying to validate the specified database copy for possible activation. Error: Database copy ‘MB-HO-03′ on server ‘HO-EX2010-MB2.exchangeserverpro.net’ has content index catalog files in the following state: ‘Failed’.. [Database: MB-HO-03, Server: HO-EX2010-MB1.exchangeserverpro.net]

An Active Manager operation failed. Error An error occurred while trying to validate the specified database copy for possible activation. Error: Database copy ‘MB-HO-03′ on server ‘HO-EX2010-MB2.exchangeserverpro.net’ has content index catalog files in the following state: ‘Failed’..

When you view the copy status of the mailbox database the content index is in a failed state.

[PS] C:\>Get-MailboxDatabaseCopyStatus | fl name, contentindexstate
Name              : MB-HO-01\HO-EX2010-MB1
ContentIndexState : Healthy
Name              : MB-HO-04\HO-EX2010-MB1
ContentIndexState : Healthy
Name              : MB-HO-03\HO-EX2010-MB1
ContentIndexState : Failed
Name              : MB-HO-02\HO-EX2010-MB1
ContentIndexState : Healthy

There are two likely causes of this issue.

  1. The content index has failed due some error or fault occurring
  2. Indexing has been disabled for that database (a common configuration for databases hosting journal mailboxes)

Fixing Failed Content Indexes

To resolve the issue update the content index on the server on which it has failed.

[PS] C:\>Update-MailboxDatabaseCopy "MB-HO-03\HO-EX2010-MB1" -CatalogOnly

The content index should now be in a healthy state.

[PS] C:\>Get-MailboxDatabaseCopyStatus | fl name, contentindexstate
Name              : MB-HO-01\HO-EX2010-MB1
ContentIndexState : Healthy
Name              : MB-HO-04\HO-EX2010-MB1
ContentIndexState : Healthy
Name              : MB-HO-03\HO-EX2010-MB1
ContentIndexState : Healthy
Name              : MB-HO-02\HO-EX2010-MB1
ContentIndexState : Healthy

After the content index is healthy you can attempt to activate the database copy again.

Performing Database Switchovers When Indexing is Disabled

If indexing has been intentionally disabled you can still perform a database switchover using the Exchange Management Shell, by running Move-ActiveMailboxDatabase with the -SkipClientExperienceChecks switch.

[PS] C:\>Move-ActiveMailboxDatabase MB-HO-03 -ActivateOnServer HO-EX2010-MB2 -SkipClientExperienceChecks

Assuming no other issues exist with the database the move should complete successfully.


This article Cannot Activate Database Copy: Content Index Catalog Files in Failed State is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

How to Backup Exchange Server 2013 Databases Using Windows Server Backup

$
0
0

In this article we’ll look at how to use Windows Server Backup on Windows Server 2012 to backup the databases on an Exchange Server 2013 Mailbox server.

For this demonstration a standalone Mailbox server (one that is not a member of a database availability group) hosts a single mailbox database.

[PS] C:\>Get-MailboxDatabase -Server E15MB3
Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
Mailbox Database 3             E15MB3          False           None

Installing Windows Server Backup

Before we can back up the database of course we need to install Windows Server Backup. You can install this using PowerShell.

PS C:\> Install-WindowsFeature Windows-Server-Backup
Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {Windows Server Backup}

Configuring a Scheduled Backup

The next step is to configure a scheduled backup job. Open Windows Server Backup on the server.

 

exchange-2013-database-backup-01

In the Local Backup area of the console launch the Backup Schedule… wizard.

exchange-2013-database-backup-02

Click Next to move to the backup configuration selection. A full server backup is recommended, but if for some reason you only want to back up the Exchange database you can choose Custom instead.

exchange-2013-database-backup-03

If you’ve chosen a custom configuration you will then need to click Add Items and add the volumes that contain the Exchange mailbox database and log files. If you have chosen Full Server then this step will not be required.

exchange-2013-database-backup-04

Next, click Advanced Settings and on the VSS Settings tab make sure VSS full backup is chosen. If you have chosen a Full Server backup then this step will not be required.

exchange-2013-database-backup-05

Continue through the wizard and choose a backup schedule, either once per day or multiple times per day.

exchange-2013-database-backup-06

Choose the backup destination. For this demonstration I’m using the recommended method of a local hard disk that is dedicated for backups.

exchange-2013-database-backup-07

You may need to click Show All Available Disks if you do not immediately see the disk you wish to use as a backup destination.

exchange-2013-database-backup-10

The disk will be reformatted for use by Windows Server Backup, which will erase any previous data stored on it.

exchange-2013-database-backup-11

Review your selections and click Finish to create the scheduled backup job.

exchange-2013-database-backup-12

Manually Running a Backup

You can manually run a backup by launching the Backup Once… wizard.

exchange-2013-database-backup-13

This gives you the choice of using the same settings that are configured for the scheduled backup job, or running through the same wizard shown above to choose settings for a one-off backup job.

Checking Backup Status

The status of backup jobs is reported in the Windows Server Backup console.

exchange-2013-database-backup-14

You can also check the last backup time stamp on the mailbox database itself.

[PS] C:\>Get-MailboxDatabase -Server E15MB3 -Status | fl name,last*backup
Name                   : Mailbox Database 3
LastFullBackup         : 11/18/2013 10:51:41 PM
LastIncrementalBackup  :
LastDifferentialBackup :
LastCopyBackup         :

This article How to Backup Exchange Server 2013 Databases Using Windows Server Backup is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

     

My Move From Google Apps to Office 365

$
0
0

It often comes as a surprise to people that the guy from the Exchange Server Pro website would use Google Apps as his email provider, but the fact is I’ve been a Google Apps user for many, many years. In fact, as far as I can tell I started using Google Apps sometime in 2008.

There were a few reasons I went with Google Apps at the time.

  • It was free (it no longer is)
  • It had a decent user interface
  • No need to mess about with email clients on my various computers
  • It had some handy features for managing different sender addresses
  • The spam filtering was very effective

Basically it did the job, and there were few if any alternatives out there worth looking at.

office-365-logo

In 2011 Microsoft launched Office 365. I’d had some less than impressive experiences with their BPOS service before that, so I didn’t think too much of it at the time. All my work continued to be on-premises deployments of Exchange Server, and the thought of moving from a free Google Apps service I was happy with to a paid Office 365 service was not all that appealing.

In 2012 I was awarded as a Microsoft MVP for the first time. One of the benefits offered was a 1 year Office 365 subscription for a small number of licenses, that we can use for testing etc. Not having much free time I didn’t give it more than a quick look. Again all the local work I was doing was on-premises, though I was well aware that Office 365 was a big focus for Microsoft and my fellow MVPs in other parts of the world were doing quite a lot of work with it.

In the last few months I’ve been increasingly frustrated with some of the moves Google is making in various areas, and their email service in particular. They’re all little things, but they add up over time, and the last straw was an update to the Gmail app for iOS that turned a perfectly functional user interface into a horrible experience.

I decided to make the move to Office 365.

This was not just about getting away from Google Apps, there were several positive drivers for this decision as well.

  • At $60/yr for the single user license I needed, it was on par with $50/yr for a Google Apps service only Office 365 also has Lync
  • The “Wave 15″ service is actually very good, running on Exchange 2013 and having an excellent Outlook Web App interface
  • A small business I look after will be moving from SBS 2008 to Office 365 soon, so this lets me kick the tyres a bit
  • I am a Microsoft IT pro, and as much as possible I like to stay in the Microsoft space despite all the ups and downs of this year (*cough*TechNet*cough*)

Now you might be wondering why price comes into if I get a free Office 365 subscription as an MVP.

Basically I want to own the license, purchased properly through the local channel, and not run into any problems later with my email sitting in a “trial” subscription in the wrong part of the world. $60/yr is no big deal when you look at it from that perspective.

I had a few false starts signing up due to an expired 30 day trial still attached to my account with Telstra (the Australian reseller for Office 365). After that was cleared up signup was quick and easy.

Adding and verifying a domain is done via the usual methods, such as adding a TXT record with a value that Microsoft provides to you. It was interesting to see that Office 365 can host your DNS for you. I really should have chosen that option as I then ran into problems adding all of the required SRV records to DNS using my DNS host’s admin interface. Eventually I found a solution for that though, and after changing my MX records to point each of my domains at Office 365 I started looking at my options for migrating all my email across.

There were three migrations options I considered:

  1. Using a Connected Account (basically pulls the mail across using POP or IMAP)
  2. Using the Office 365 migration tool (I did not end up trying this)
  3. Using MigrationWiz, a third party service (they have not paid me to mention them here)

First I tried the Connected Account method. This seemed to be working okay at first. Everything was being downloaded to the Inbox, which was going to mean a bit of tidy up afterwards, but that was not a concern.

Unfortunately after about 24 hours and only about half my email being migrated the process got stuck and nothing more came across. I thought perhaps I had run into one of the daily download limits that Google Apps enforces, but even after a couple more days it still wasn’t working.

Since I was considering MigrationWiz for the upcoming small business migration I decided to give that a try instead. At $11.99 for a “Premium” license it seemed like a good deal to me. An added bonus was the option to convert Gmail labels into folders, rather than everything go into one single folder. This can mean some duplicate items in the destination mailbox, but since most of my mail was either given a single label or none at all I didn’t see any serious problem there.

MigrationWiz has been a pleasant surprise. The process is not flawless, and some folks have mentioned a few caveats to me for certain scenarios, but for my needs it has done the job quite well. There has been a bit of tuning required to increase things like error limits, which will be of no surprise to anyone who has had to migrate an Exchange mailbox with a lot of bad items in it. In the end it did exactly what I needed it to do, brought across all of my email (minus a few errors) and turning labels into folders which has let me tidy up a lot faster than having everything dumped into one folder.

With the migration finished I am now settling in to my new Office 365 mailbox and doing a little fine tuning of spam settings and inbox rules. I’m using Outlook Web App most of the time, as well as the OWA app for iOS on my iPhone and iPad. As I get my mailbox organization back under control I will probably start using Outlook 2013 on my main computer as well.

As a side benefit of the move I also split out my personal domain name and attached that to Outlook.com, so my business and personal emails are now separate again.

Overall I am very happy. For all the drama lately with the perception that Microsoft is pushing everyone to the cloud, and that the cloud has too many cons to offset the benefits, I have to say that Office 365 is an excellent service and well worth considering.


This article My Move From Google Apps to Office 365 is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Exchange Server 2013 Service Pack 1 Announced

$
0
0

The Microsoft Exchange Server team has announced the upcoming availability of Service Pack 1 for Exchange Server 2013, scheduled for release in “early 2014″.

Among the changes and improvements planned for Service Pack 1:

  • Support for running Exchange Server 2013 on Windows Server 2012 R2
  • The return of the Edge Transport server role
  • S/MIME support for Outlook Web App
  • Many more fixes and improvements

The team also said that Service Pack 1 is essentially CU4. Considering we are at CU2 right now that leaves open the question of when CU3 will be released.

UC Architect Dave Stork noticed in the last few days a number of KB articles were published that listed fixes that were included in CU3, however those KB articles have since been removed. The publishing of specific KBs like that usually coincides with the release of an update or service pack. In their blog post about SP1 Microsoft did hint that more info about CU3 is “imminent”, so perhaps the KB articles were accidentally published too soon, and were removed until CU3 is formally released. I’m sure we’ll find out soon.

 


This article Exchange Server 2013 Service Pack 1 Announced is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Test-ExchangeServerHealth.ps1 V1.07 Released

$
0
0

Version 1.07 of the Test-ExchangeServerHealth.ps1 script has been released.

This version fixes one issue with the handling of content indexes on databases that have been intentionally disabled by administrators (eg because the database hosts journal mailboxes). Those content indexes will now be reported as “Disabled” instead of “Failed”.

The script is available to download from the Insiders member area. If you’re not already a member you can join for free here.


This article Test-ExchangeServerHealth.ps1 V1.07 Released is © 2013 ExchangeServerPro.com

Get more Exchange Server tips at ExchangeServerPro.com

Viewing all 530 articles
Browse latest View live


Latest Images