Home » Exchange Server » PowerShell Script to Check Active Directory System Requirements

PowerShell Script to Check Active Directory System Requirements

The system requirements for Exchange Server 2013 include the following for Active Directory:

  • Forest and domain functional level of Windows Server 2003 or higher (up to Windows Server 2012 R2 is supported with Exchange Server 2013 SP1 or later)
  • Schema Master running Windows Server 2003 SP2 or later
  • At least one global catalog server in each Active Directory site where Exchange 2013 will be installed that runs Windows Server 2003 SP2 or higher

Using PowerShell we can retrieve all of this information quickly.

Here is a quick and dirty script I wrote that breaks a whole lot of PowerShell “rules” but gets the job done. I’ll probably try and improve it in the near future, but for now it gets me the information I need, which is all I really need any script to do.

Download the script from Github

The script requires the ActiveDirectory PowerShell module, and in a multi-domain forest should be run in the forest root domain with an admin account that can access each domain.

Example output:

Paul is a Microsoft MVP for Office Servers and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul is a co-author of Office 365 for IT Pros and several other books, and is also a Pluralsight author.
Category: Exchange Server

9 comments

  1. David Ray says:

    It seems like Microsoft did something is some update to cause Get-ADDomainContoller -Filter to not work as expected (like it used to).
    I got this script to work by replacing
    Line 117: $domaincontrollers =@(Get-ADDomainController -Filter {IsGlobalCatalog -eq $true})
    with
    Line 117: $domaincontrollers = @(Get-ADForest | Select -ExpandProperty GlobalCatalogs | foreach{Get-ADDomainController $_})

    Different way to get the same information.

  2. austin says:

    Does not work. Sadly I am not sure why.

    At C:Get-ADInfo.ps1:41 char:4
    + 39 $htmlreport = $null
    + ~~~~~~~~~~~
    Unexpected token ‘$htmlreport’ in expression or statement.
    At C:Get-ADInfo.ps1:42 char:4
    + 40 $htmlbody = $null
    + ~~~~~~~~~
    Unexpected token ‘$htmlbody’ in expression or statement.
    At C:Get-ADInfo.ps1:43 char:4
    + 41 $htmlfile = “ADInfo.html”
    + ~~~~~~~~~
    Unexpected token ‘$htmlfile’ in expression or statement.
    At C:Get-ADInfo.ps1:44 char:4
    + 42 $spacer = “”
    + ~~~~~~~
    Unexpected token ‘$spacer’ in expression or statement.
    At C:Get-ADInfo.ps1:47 char:4
    + 44 Import-Module ActiveDirectory
    + ~~~~~~~~~~~~~
    Unexpected token ‘Import-Module’ in expression or statement.
    At C:Get-ADInfo.ps1:55 char:4
    + 50 $forest = Get-ADForest
    + ~~~~~~~
    Unexpected token ‘$forest’ in expression or statement.
    At C:Get-ADInfo.ps1:58 char:4
    + 52 $htmlbody += “Forest Details”
    + ~~~~~~~~~
    Unexpected token ‘$htmlbody’ in expression or statement.
    At C:Get-ADInfo.ps1:61 char:4
    + 54 $forestinfo = New-Object PSObject
    + ~~~~~~~~~~~
    Unexpected token ‘$forestinfo’ in expression or statement.
    At C:Get-ADInfo.ps1:64 char:4
    + 56 Write-Host -ForeGroundColor Yellow “*** Forest: $($forest.RootDomain) ***”
    + ~~~~~~~~~~
    Unexpected token ‘Write-Host’ in expression or statement.
    At C:Get-ADInfo.ps1:65 char:4
    + 57 Write-Host “”
    + ~~~~~~~~~~
    Unexpected token ‘Write-Host’ in expression or statement.
    Not all parse errors were reported. Correct the reported errors and try again.
    + CategoryInfo : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken

Leave a Reply

Your email address will not be published. Required fields are marked *