• Home
  • Topics
    • Office 365
    • Teams
    • SharePoint
    • Exchange 2019
    • Exchange 2016
    • Exchange 2013
    • Hybrid
    • Certificates
    • PowerShell
    • Migration
    • Security
    • Azure
  • Blog
  • Podcast
  • Webinars
  • Books
  • About
  • Subscribe
    • Facebook
    • Twitter
    • RSS
    • YouTube

Practical 365

You are here: Home / Exchange Server / PowerShell Script to Check Active Directory System Requirements

PowerShell Script to Check Active Directory System Requirements

March 10, 2014 by Paul Cunningham 10 Comments

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[PS] C:Scripts>.Get-ADInfo.ps1
*** Forest: exchangeserverpro.net ***
 
Forest Mode: Windows2003Forest
Schema Master: S1DC1.exchangeserverpro.net
Domain Naming Master: S1DC1.exchangeserverpro.net
UPN Suffixes: esp.local
 
*** Domain: exchangeserverpro.net ***
 
NetBIOS Name: ESPNET
Domain Mode: Windows2003Domain
PDC Emulator: S1DC1.exchangeserverpro.net
Infrastructure Master: S1DC1.exchangeserverpro.net
RID Master: S1DC1.exchangeserverpro.net
 
*** Global Catalogs by Site/OS ***
 
Site, OS                                       Count
--------                                       -----
DataCenter1, Windows Server 2012 R2 Datacenter     1

Exchange Server Active Directory, Exchange 2013, Migration, PowerShell, Scripts

Comments

  1. austin says

    January 21, 2016 at 5:13 am

    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

    Reply
    • Paul Cunningham says

      January 21, 2016 at 11:15 am

      I think you should double check that what you downloaded was the complete script, only containing the PowerShell code, and no extra HTML code from Github’s site got mixed in.

      Reply
      • Sandy Rodrigues says

        January 14, 2020 at 11:41 pm

        getting this error

        Unexpected token ‘htmlreport’ in expression or statement.
        At C:\Users\XXXXXX\Desktop\adinfo.ps1:35 char:15
        + 33 $htmlreport <<<< = $null
        + CategoryInfo : ParserError: (htmlreport:String) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : UnexpectedToken

        Reply
  2. David Ray says

    July 14, 2015 at 4:01 am

    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.

    Reply
    • Paul Cunningham says

      July 14, 2015 at 10:07 am

      Which version of Windows were you running it from?

      Reply

Leave a Reply Cancel reply

You have to agree to the comment policy.

Recent Articles

  • Hands-on SharePoint Syntex Blog Series – Part I
  • The Practical 365 Weekly Update: S2, Ep 8 – What to expect in 2021, Solarigate, TLS in Exchange and new Teams updates
  • Security updates released for Exchange and SharePoint Servers 2010 to 2019
  • The Practical 365 Weekly Update: S2, Ep 7 – Urgent Exchange security updates, new Teams features launch
  • How to train your users against threats with Attack Simulation Training
Practical 365

Related Posts

Related Posts

Training Courses

  • Configuring and Managing Office 365 Security
  • Office 365 Admin Playbook
  • Exchange 2016 Exam 70-345
  • Managing Exchange Mailboxes and Distribution Groups in PowerShell
  • More Training Courses...

Recommended Resources

  • Office 365 Security Resources
  • Office 365 Books
  • Exchange Server Books
  • Exchange Server Migrations
  • Exchange Analyzer
  • Digicert SSL Certificates

About This Site

Practical 365 is a leading site for Office 365 and Exchange Server news, tips and tutorials. Read more...

Find out more about advertising with us.

Contact us


Subscribe to our newsletter
  • Facebook
  • Twitter
  • RSS
  • YouTube

Copyright © 2021 Quadrotech Solutions AG · Disclosure · Privacy Policy
Alpenstrasse 15, 6304 Zug, Switzerland