#Requires -Version 3.0 #requires -Module ActiveDirectory #requires -Module GroupPolicy #This File is in Unicode format. Do not edit in an ASCII editor. Notepad++ UTF-8-BOM <# .SYNOPSIS Creates a complete inventory of a Microsoft Active Directory Forest or Domain. .DESCRIPTION Creates a complete inventory of a Microsoft Active Directory Forest or Domain using Microsoft PowerShell, Word, plain text, or HTML. Creates a Word or PDF document, text, or HTML file named after the Active Directory Forest or Domain. Version 3.0 changes the default output report from Word to HTML. Word and PDF document includes a Cover Page, Table of Contents, and Footer. Includes support for the following language versions of Microsoft Word: Catalan Chinese Danish Dutch English Finnish French German Norwegian Portuguese Spanish Swedish The script requires at least PowerShell version 3 but runs best in version 5. Word is NOT needed to run the script. This script outputs in Text and HTML. You do NOT have to run this script on a domain controller. This script was developed and run from a Windows 10 VM. While most of the script can run with a non-admin account, there are some features that will not or may not work without domain admin or enterprise admin rights. The Hardware and Services parameters require domain admin privileges. The script does gathering of information on Time Server and AD database, log file, and SYSVOL locations. Those require access to the registry on each domain controller, which means the script should now always be run from an elevated PowerShell session with an account with a minimum of domain admin rights. Running the script in a forest with multiple domains requires Enterprise Admin rights. The count of all users may not be accurate if the user running the script does not have the necessary permissions on all user objects. In that case, there may be user accounts classified as "unknown". To run the script from a workstation, RSAT is required. Remote Server Administration Tools for Windows 7 with Service Pack 1 (SP1) https://carlwebster.sharefile.com/d-sace5ee0f1ada47289ca14be544878a24 Remote Server Administration Tools for Windows 8 https://carlwebster.sharefile.com/d-s791075d451fc415ca83ec8958b385a95 Remote Server Administration Tools for Windows 8.1 https://carlwebster.sharefile.com/d-s37209afb73dc48f497745924ed854226 Remote Server Administration Tools for Windows 10 http://www.microsoft.com/en-us/download/details.aspx?id=45520 .PARAMETER ADDomain Specifies an Active Directory domain object by providing one of the following property values. The identifier in parentheses is the LDAP display name for the attribute. All values are for the domainDNS object that represents the domain. Distinguished Name Example: DC=labaddomain,DC=com GUID (objectGUID) Example: b147a813-9938-4a89-bc93-58a0d36c41c3 Security Identifier (objectSid) Example: S-1-5-21-3916992870-515249095-1421388220 DNS domain name Example: labaddomain.com NetBIOS domain name Example: labaddomain If both ADForest and ADDomain are specified, ADDomain takes precedence. .PARAMETER ADForest Specifies an Active Directory forest object by providing one of the following attribute values. The identifier in parentheses is the LDAP display name for the attribute. Fully qualified domain name Example: labaddomain.com GUID (objectGUID) Example: b147a813-9938-4a89-bc93-58a0d36c41c3 DNS host name Example: labaddomain.com NetBIOS name Example: labaddomain Default value is $Env:USERDNSDOMAIN If both ADForest and ADDomain are specified, ADDomain takes precedence. .PARAMETER ComputerName Specifies which domain controller to use to run the script against. If ADForest is a trusted forest, then ComputerName is required to detect the existence of ADForest. ComputerName can be entered as the NetBIOS name, FQDN, localhost, or IP Address. If entered as localhost, the actual computer name is determined and used. If entered as an IP address, an attempt is made to determine and use the actual computer name. This parameter has an alias of ServerName. Default value is $Env:USERDNSDOMAIN .PARAMETER MaxDetails Adds maximum detail to the report. This is the same as using the following parameters: DCDNSInfo GPOInheritance Hardware IncludeUserInfo Services WARNING: Using this parameter can create an extremely large report and can take a very long time to run. This parameter has an alias of MAX. .PARAMETER HTML Creates an HTML file with an .html extension. HTML is now the default report format. This parameter is set True if no other output format is selected. .PARAMETER Text Creates a formatted text file with a .txt extension. This parameter is disabled by default. .PARAMETER AddDateTime Adds a date timestamp to the end of the file name. The timestamp is in the format of yyyy-MM-dd_HHmm. June 1, 2022 at 6PM is 2022-06-01_1800. Output filename will be ReportName_2022-06-01_1800.docx (or .pdf). This parameter is disabled by default. This parameter has an alias of ADT. .PARAMETER CompanyName Company Name to use for the Word Cover Page or the Forest Information section for HTML and Text. Default value for Word output is contained in HKCU:\Software\Microsoft\Office\Common\UserInfo\CompanyName or HKCU:\Software\Microsoft\Office\Common\UserInfo\Company, whichever is populated on the computer running the script. This parameter has an alias of CN. For Word output, if either registry key does not exist and this parameter is not specified, the report does not contain a Company Name on the cover page. For HTML and Text output, the Forest Information section does not contain the Company Name if this parameter is not specified. .PARAMETER Dev Clears errors at the beginning of the script. Outputs all errors to a text file at the end of the script. This is used when the script developer requests more troubleshooting data. The text file is placed in the same folder from where the script runs. This parameter is disabled by default. .PARAMETER Folder Specifies the optional output folder to save the output report. .PARAMETER Log Generates a log file for troubleshooting. .PARAMETER ScriptInfo Outputs information about the script to a text file. The text file is placed in the same folder from where the script runs. This parameter is disabled by default. This parameter has an alias of SI. .PARAMETER ReportFooter Outputs a footer section at the end of the report. This parameter has an alias of RF. Report Footer Report information: Created with: