Create an HTML report of AD Info with PowerShell

The intent of this script is to quickly get some basic information about an Active Directory infrastructure. I have used it when I’m doing some work on an environment I’m not familiar with, it gives you a quick look at what you’re dealing with without a whole lot of effort.

NOTE: I tested this code exclusively on a domain with Windows Server 2012 R2 and Windows Server 2016 Domain Controllers with PowerShell V5 and V5.1

My script will display the following information:

Forest Information

  • Forest Root Domain
  • Forest Functional Level
  • Domains in the forest
  • AD Recycle BIN status

Domain Information

  • Domain Functional Level
  • NETBIOS name

FSMO Roles

  • Domain Naming Master
  • Schema Master
  • PDC Emulator
  • RID Master
  • Infrastructure Master

Domain Controller Information

  • Domain
  • Forest
  • Computer Name
  • IP Address
  • Global Catalog
  • Read Only
  • Operating System
  • Operating System Version
  • Site

DNS Information

  • Primary Zones
  • NS Records
  • MX Records
  • Forwards
  • Scavenging Enabled
  • Aging Enabled

DHCP Information

  • Computer Name
  • IP Address

Site Information

  • Site Names
  • Intersite Links
  • Name
  • Site Included
  • Site Cost
  • Site Replication Frequency

GPO Information

  • Domain Name
  • Display Name
  • Creation Time
  • Modification Time

Privileged Account Information

  • Enterprise Admin Group Members
  • Domain Admin Group Members
  • Schema Admin Group Members
  • Accounts that Passwords Never Expire

Exchange Information

  • Organization Management Group Members
  • Exchange Server

Feel free to take the code and make it your own.