Posts Tagged ‘Exchange 2013’

Exchange 2013 Step By Step: AD Preparation Notes

February 28th, 2013 No comments

First step to get to an installation of Exchange server is to make the Active Directory ready for it. So lets have a quick look at AD Preparation for Exchange Server 2013.

 Steps involved in Active Directory Preparation


  1. Schema master, Global Catalogue, and Domain Controller
    1. Minimum – Windows Server 2003 Standard with SP2
    1. Supported Up to – Windows Server 2012
    1. Read Only Domain Controller can not be used by Exchange
  1. Active Directory Forest Functional Level
    1. Windows Server 2003 or Higher
  1. Operating System and its components on the server where setup tasks are executed
    1. Install Pre-Requisite Softwares (These are included in Windows Server 2012 – so no need to install separately)
      1. Microsoft .Net Framework 4.5
      2. Windows Management Framework 3.0
    1. Install Active Directory Administration tools
      1. From Powershell run below cmdlets
      1. On Windows Server 2012: Install-WindowsFeature RSAT-ADDS
      1. On Windows Server 2008 R2 SP1: Add-WindowsFeature RSAT-ADDS
  1. Permissions

The account used to executed AD Preparation Tasks need below permissions

a) For SchemaPrep

=> Member of Schema Admins and Enterprise Admins AD Group

b) For PrepareAD

=> Member of Enterprise Admins AD Group

c) For preparing all of your domains together(if you have multiple Domains where you will have Exchange Servers or Recipients)

=> Member of Enterprise Admins AD Group

d) For Preparing the currently logged on Domain or a Named Domain

1) If the Domain was already existing before Preparing AD for Exchange

=> The account needs to be member of the Domain Admins AD Group on the particular domain you are preparing

2) If the Domain was created after the AD was prepared for Exchange

=> The account needs to be member of “Organization Management” RBAC Group and “Domain Admins” AD Group

  1. Multi forest environment: If you have multiple forests, make sure you are preparing your Exchange forest(the AD forest where you want to deploy Exchange Server 2013) and not the other forests.
  2. Where to run the AD Preparation Tasks
    1. On a 64bit Member Server or
    1. On a 64bit Writable Domain Controller
    1. PrepareSchema and PrepareAD should be run from the same AD site as Schema Master


Steps to prepare AD:

If your Active Directory and Exchange is managed by same IT Team, its quick straight forward:
Note: Setup program is available in Exchange 2013 Media
Note: With all the setup commands you must specify /IAcceptExchangeServerLicenseTerms, this is different from Exchange 2010.


From PowerShell or Command Prompt execute below (Make sure you run them with Elevated Rights):

Option 1)

Execution: Setup /PrepareAD [/OrganizationName:<organization name>]  or setup /p [/on:<organization name>]

Verification:  msExchProductId attribute value of the Organization Container should be 15.00.0516.032


Option 2) Run your first exchange server setup installation using GUI Wizard, it will prepare all the AD Preparation Tasks during the setup

Note:- This is not possible if you are not planning to install any Exchange server in the same site as Schema Master because some times Schema Master is kept in an isolated AD Site


If your AD Team and Exchange Team has separate Active Directory Rights and Restrictions:


Note: – Make sure you wait for AD Replication to be complete before proceeding from one step to another, otherwise you might end up in an error like below:



1) Preparing Schema

Execution: Setup /PrepareSchema  or setup /ps

Verification: After the successful completion of Schema Preparation, the value of rangeUpper will be 15137 on ms-Exch-Schema-Version-Pt Attribute, you can view this by using ADSIEDIT, LDP.exe, Schema Management MMC Snapin, or even by using Powershell.


2) Preparing AD (Exchange Organization Preparation and Current Domain Preparation)

Execution: setup /PrepareAD [/OrganizationName:<organization name>] or setup /p [/on:<organization name>]


ObjectVersion attribute value of the Organization container should be 15449

msExchProductId attribute value of the Organization Container should be 15.00.0516.032

ObjectVersion attribute value of the “Microsoft Exchange System Objects” OU in the root domain should be 13236

A New group called “Exchange Install Domain Servers” is created under the MESO OU (read previous line).

Check  if the “Microsoft Exchange Security Groups” OU is created in the root domain and it contains the default RBAC Security Groups:


3) Preparing a Domain (Other than the domain where we did ran PrepareAD – PrepareAD prepares the Local Domain as well)

Execution:  setup /PrepareDomain or setup /pd

To prepare all the domains in your Forest:  setup /PrepareAllDomains or setup /pad


A new group called “Exchange Install Domain Servers” is created in the local Domain under the “MESO”(Microsoft Exchange System Objects) OU

Exchange Install Domain Servers group is member of the “Exchange Servers” Group in the root domain


For a granular steps on the verification aspect, refer an old post here, which is for Exchange 2013 Preview but the verification methods still remain same.

In the next post we will have a look at the Server Installation steps in different scenarios.

Cheers, and share your comments below if any.

Exchange 2013: Inconsistency in unattended setup help

November 24th, 2012 No comments


Did you read Exchange 2013 Release Notes?.  If the answer is No, then I strongly recommend you should read it once. Its not only for Exchange but for any application you decide to play around and most importantly if it’s a newly released product. What is my practice is to read at least once the release notes, the system requirements, the pre-requisites, and then a quick look to the installation steps article.

There are currently few inconsistencies in the setup.exe command line help, which you get when you type “setup.exe /help” or setup.exe /help:install or /help:uninstall. We will look at currently known two such issues:


1) Unsupported /Uninstall mode:

Check the setup.exe /help:install or /help:uninstall output and you can see, it says you can uninstall a single role out of a server where both mailbox and client access roles are installed.


Lets try it:

An attempt to uninstall Mailbox role from a combined role server:


Lets try it from the GUI:

From control panel -> Programs and Features -> Select Exchange 2013 and click on “Change”

If you go and run the setup now from the installation media, you get a setup screen which will not allow you to uncheck any installed roles:


From control panel -> Programs and Features -> Select Exchange 2013 and click on ”Uninstall”


Selecting Uninstall or running setup.exe /mode:uninstall without any more parameter is the right way to remove an Exchange Installation.


Now lets see what the documentation says:

Extract from Release Notes


Example shown in Install Exchange 2013 Using Unattended Mode documents the correct option:


What all these mean is planning is very important even you are setting up a LAB environment.


2)  Misleading /LogFolderPathUse optional parameter:

I wanted to install my second server and didn’t want the database which will be created with installation of every mailbox server to be hosted to its default location and move it around later. Hence i decided to specify the database parameters during setup and now I needed to figure out the complete syntax to use.

I use setup.exe /help:install to check the options, below screenshot is just partial output of the command and showing relevant information which I was looking for. So it shows the three parameters I should use to provided custom database name and its file paths.


I fire the setup and it throws the error, “The parameter ‘logfolderpathuse’ is not a recognized option.” 


The TechNet article Install Exchange 2013 Using Unattended Mode documents the correct option.


Now the setup completes successfully and the database is created with its provided name and in the provided path.

That’s it for now, so we should always read the minimum documentation before attempting to use a new application.



Categories: Exchange Tags:

Exchange Server 2013 Makes It Easier: Finding Database Storage Information

November 23rd, 2012 No comments

Q:Why a post on this, topic?

Ans:In few of my Exchange automation and reporting scripts I have to figure out storage statistics of databases such as total capacity, free space, free space percentage etc. And I find it more easier to discover such information in Exchange 2013.

In this post, I will show some sample Powershell snippets I used to get the statistics on Exchange 2010 and later we will see how to get the same information from Exchange 2013.


Finding Exchange 2010 Mailbox Database Storage Information:

Note: All below Cmdlets have to be executed from Exchange Management Shell.  If you use native powershell.exe and PSSession method without using Exchange Remoting module it may behave differently due to Deserialization.

Scenario 1: Database is hosted on a Lun/Disk with Drive Letter Assigned


1) Getting Database Details

$DB = "MBX-DB01"
$Database = Get-MailboxDatabase $DB
$DBServer = $Database.Server.Name
$DBLun = $Database.EdbFilePath.DriveName


2) Calling WMI to get the volume information

#Below cmdlet should be run in one line
$Lun = Get-WmiObject -Class WIn32_Volume -Filter "DriveLetter='$DBLun'" `
-ComputerName $DBServer -Property DriveLetter,Capacity,FreeSpace

3) Composing the useful information

$DiskName = $Lun.DriveLetter
 $DiskCapacity = [math]::round(($Lun.Capacity/1GB),2)
 $DiskFreeSpace = [math]::round(($Lun.FreeSpace/1GB),2)

In above two lines, we are converting the byte value to GB and rounding it to two decimal point

4) Finding Percentage of Free Space

$FreePercentValue = [math]::round(($DiskFreeSpace * 100 / $DiskCapacity),2)

Use above cmdlet if you want to further use the value for operations such as comparison or sorting.

Use below if your purpose is just to print or report, the difference is nothing but, in above method the actual value if it is 82.10 will be shown as 82.1 and in below method it will still show as 82.10 but the difference is below will give you a string value and you cannot do mathematical operations with strings.

$FreePercentage = "{0:N2}" -f $FreePercentValue


Scenario 2: Database is hosted on a Lun/Disk with MountPoint Access Path

1) Getting Database Information

 $DB = "MBX-DB02" $Database = Get-MailboxDatabase
 $DB $DBServer = $Database.Server.Name
 #We are not using drive letter here as there is no -
 #drive letter assigned to the volume.
 $DBLun = $Database.EdbFilePath.PathName

Now we have to make a correct calculation to refer to the mount point. The mounted folder information is stored in two properties of win32_volume instance. Those are Caption and Name.  But how do you know dynamically what is the mount volume path from just the complete path of a database, not possible.  Here you should know the importance of having standards for naming convention, if you have a unique naming convention for your Database Luns and Mount Volumes , you can use something like this. In my scenario the total length of the Mount Volume from the Edbfile path was 24. So I extract a substring to match with the mount volume. Secondly I am replacing every back slash with two backslash, this is not a must but if you are using WMI Query you need to provide two slashes and not one.


$DBLun = $DBLun.Substring(0,24)
$DBLun = $DBLun.Replace("\","\\")
$Lun = Get-WmiObject -Class WIn32_Volume -Filter "Name='$DBLun'" `
-ComputerName $DBServer -Property Name,Capacity,FreeSpace

There is no drive letter, so we record only the mounted volume path from the Name property.

$DiskName = $Lun.Name
$DiskCapacity = [math]::round(($Lun.Capacity/1GB),2)
$DiskFreeSpace = [math]::round(($Lun.FreeSpace/1GB),2)


Calculating Percentage Value

$FreePercentValue = [math]::round(($DiskFreeSpace * 100 / $DiskCapacity),2)
[string]$FreePercentage = "{0:N2}" -f $FreePercentValue


From above you can see, such a task would be not easy but manageable in a single on-premise or SMB environment. What about a large distributed enterprise or even in hosting environments. Here Exchange 2013 comes to rescue. You don’t have to make a single WMI call to get above described information. Everything is available from Exchange 2013 Mailbox Database Cmdlets.


A Quick look at Exchange 2013 Improvements in this Context:

I will try to show the changes by using the practical approach here. we will only explore the possibilities, it can be used in different ways according to your need.

$DB = "MBX-DB03"
$Database = Get-MailboxDatabase $DB
$DBServer = $Database.Server.Name
$DBCopyStatus = Get-MailboxDatabaseCopyStatus -identity $DB\$DBServer


Above you see I have used Get-MailboxDatabase cmdlet, which will give me the server name where the DB is currently mounted. Next I use Get-MailboxDatabaseCopyStatus cmdlet with -identity parameter in a form of DBName\ServerName – that is how a database copy is identified in DAG.


#Mountpoint or Drive Letter


The property DatabasePathIsOnMountedFolder and LogPathIsOnMOuntedFolder will tell you if the files are hosted on a Volume mounted to a folder or assigned with a drive letter. This is something very useful as to you no longer need to manually identify if the Database is using a mounted folder or  disk drive.


DatabaseVolumeMountPoint gives you the exact mounted folder or the drive letter

#DB Volume Mount Point or Drive Letter (Ends with "\" )
$DiskName = $DBCopyStatus.DatabaseVolumeMountPoint


LogVolumeMountPoint gives the Logs location

#Log Volume Mount Point or Drive Letter (Ends with "\" )


Surprisingly, you can even get the physical Disk Volume Name.

#Physical Disk Name


Now lets collect other information we need for reporting or other automation scripts.

$DiskCapacity = $DBCopyStatus.DiskTotalSpace
$DiskFreeSpace = $DBCopyStatus.DiskFreeSpace
$DiskFreePercentage = $DBCopyStatus.DiskFreeSpacePercent


Unfortunately above three fields are only for DB Location, If you have DB and LOG on different LUN this cmdlet doesn’t give that ( at least as per my knowledge until I write this)

What I understand is most of the above information is added or useful for the new Autoreseed feature, and the three properties below as well.


#Properties relevant to Auto Reseed


Some information around the Numbers given by Exchange Cmdlet

DiskCapacity  and DiskFreeSpace are of  Microsoft.Exchange.Data.ByteQuantifiedSize Type, means which is a complete object with some methods and properties. So use Get-Member and look at it. By default the value is printed in a number + text format (a display friendly format) but that may not be what you always want to have.  there is a bit of calculation changes:

In My Lab Database:

!Assume DiskCapactiy is 26707226624 in Bytes.

$DiskCapacity.ToGB() will  give you 24

But if you do $DiskCapacity.ToBytes()  / 1GB will give you 24.87

For some calculations that .87 is not something you can avoid.

DiskFreeSpacePercentage is an integer (System.Int32) so nothing to worry there.


Few Tips:
 #Get a list of Active Database Copies on the currently connected server
 Get-MailboxDatabaseCopyStatus -Active
 #Get a list of All Active Database Copies on a particular server
 Get-MailboxDatabaseCopyStatus -Active -Server <ServerName>
 #To get some more useful Database Statistics `
 #Such as Physical size of the Database and `
 #AvailableNewMailboxSpace (This is not exactly the thing called whitespace) `
 #Below cmdlet is not new in Exchange 2013.
 Get-MailboxDatabase <DBName> -Status

I hope you got some insights, and this post was helpful.

I am happy to learn from you as well, please drop your feedback, comments, or suggestions in the comments area.

Enjoy Learning!