Exchange 2010: Database Copies with PowerShell
I needed a quick and dirty method to add database copies to other servers in an Exchange 2010 Database Availability Group (DAG). I had three servers, each with 10 databases. Each one of those databases should have a copy on the other two servers. Now, this is painful if you have to use the GUI to do it – not that it takes a lot, but it’s time consuming. The Add-MailboxDatabaseCopy cmdlet is very helpful in PowerShell, but still I wanted to automate it since my naming conventions were pretty standard. So, I wrote a PowerShell script to automate this process. Essentially, the script has a few variables and I dome some loop magic to drop everything into place. $servers = "E2K10MBX01", "E2K10MBX02", "E2K10MBX03" $databases = "DB1", "DB2", "DB3", "DB4", "DB5", "DB6", "DB7", "DB8", "DB9", "DB10" foreach($database in $databases) { foreach($server in $servers) { foreach($copyserver in $servers) { "Adding…
Exchange 2010 Pre-Req Setup (Updated)
A couple of months back I wrote a post on how to automatically install pre-requisites for Exchange 2010 on a Windows 2008 (including R2) server. I specifically talked about a method for doing this with ServerManagerCmd.exe, which is included with Windows Server 2008. However, in Windows Server 2008 R2, ServerManagerCmd is deprecated and the recommended method is to use PowerShell (as pointed out by my buddy, Josh). The Add-WindowsFeature cmdlet in PowerShell provides the capability to add individual Windows features directly from a script. You can use Get-WindowsFeature to obtain a detailed list of available features, ones that are installed, and their “official” name if you wish to install them via PowerShell. To install the required pre-reqs for Exchange 2010, from a PowerShell prompt, be sure to add the Server Manager module so the Add-WindowsFeature and Get-WindowsFeature cmdlets are available. Import-Module ServerManager Once you have imported the module, then you…
About JB
I’ve been a technologist for over 20 years, getting my start in IT with a large Fortune 100 international retailer in the 1990s. I love to talk about new technology, mobile devices, software development, photography, and the weather. The opinions expressed on this website are my own.