Report structure improvements#246
Conversation
…ns and improve readability - Updated function calls from Add-DiaHtml* to Add-Html* for consistency across diagram generation scripts. - Replaced Remove-SpecialChar with Remove-SpecialCharacter for uniformity in string processing. - Enhanced the handling of site and trust diagrams to ensure accurate representation of relationships. - Improved the structure of the report generation process in the Todo.md file for better clarity and usability.
…tem.Resources/ subdirectory
… documentation - Bump AsBuiltReport.Diagram module version from 1.0.2 to 1.0.4 in the module manifest. - Revise CHANGELOG.md to include new features, changes, and improvements. - Update README.md to clarify compatibility with PowerShell 7+, system requirements, and Linux/macOS support. - Add comprehensive copilot instructions for project structure, build, test, architecture, and coding conventions in a new copilot-instructions.md file.
… and consistency. Improved grammar, punctuation, and readability across various best practice descriptions related to Active Directory configurations.
… for Forest, Sites, Infrastructure, GPOs, and Account Policies. Improve localization strings for English and Spanish, and handle missing infrastructure scenarios in Exchange, SCCM, and DHCP sections.
… for Forest, Sites, Infrastructure, GPOs, and Account Policies. Improve localization strings for English and Spanish, and handle missing infrastructure scenarios in Exchange, SCCM, and DHCP sections.
…ctive Directory configuration and integrate it into the report generation process
…ief function in Invoke-AsBuiltReport.Microsoft.AD
There was a problem hiding this comment.
Pull request overview
This PR restructures the Microsoft AD As Built Report to improve section organization, add a brief “report overview” page, and migrate diagram-related dependencies from Diagrammer.Core to AsBuiltReport.Diagram (plus chart support).
Changes:
- Adds a new “Report Brief” section and reorganizes Forest/Domain subsections (Sites, Infrastructure, Replication, GPO, Health Checks).
- Migrates diagram generation/helpers to the AsBuiltReport.Microsoft.AD module layout and updates documentation/dependencies accordingly.
- Introduces multiple new helper functions (WinRM/CIM session helpers, charts, AD health/lookup helpers) to support the new structure.
Reviewed changes
Copilot reviewed 36 out of 117 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Src/Private/Get-AbrADReplicationInfo.ps1 | Removes legacy replication info function from old path (function now lives under module folder). |
| README.md | Updates supported PowerShell versions, required modules, and Known Issues formatting/wording. |
| CHANGELOG.md | Expands 0.9.12 release notes with structural/doc/module dependency changes. |
| AsBuiltReport.Microsoft.AD/Src/Public/Invoke-AsBuiltReport.Microsoft.AD.ps1 | Inserts Report Brief generation early in report build. |
| AsBuiltReport.Microsoft.AD/Src/Private/Test-WinRM.ps1 | Adds WinRM connectivity test helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/Test-ComputerPort.ps1 | Adds TCP/UDP port test helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/Show-AbrDebugExecutionTime.ps1 | Adds execution-time logging helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/New-AbrADDiagram.ps1 | Updates diagram helper function names to new diagram module wrappers. |
| AsBuiltReport.Microsoft.AD/Src/Private/Invoke-DcDiag.ps1 | Adds helper to run dcdiag remotely and parse results. |
| AsBuiltReport.Microsoft.AD/Src/Private/Invoke-CommandWithTimeout.ps1 | Adds timeout wrapper for remote Invoke-Command calls. |
| AsBuiltReport.Microsoft.AD/Src/Private/Images.ps1 | Adds image map for diagram icon names to filenames. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-WinADLastBackup.ps1 | Adds helper to compute last AD backup timestamps per naming context. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-WinADDuplicateSPN.ps1 | Adds helper intended to find duplicate SPNs. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-WinADDuplicateObject.ps1 | Adds helper to find AD conflict/duplicate objects. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ValidPSSession.ps1 | Adds cached WinRM PSSession creation/reuse helper with SSL fallback. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ValidDCfromDomain.ps1 | Adds helper to pick a reachable DC for a domain. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ValidCIMSession.ps1 | Adds cached CIM session creation/reuse helper with SSL fallback. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-RequiredModule.ps1 | Adds required-module version validation helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-RequiredFeature.ps1 | Adds required Windows feature/capability validation helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-PieChart.ps1 | Adds PScriboCharts pie chart generator returning Base64. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-DCWinRMState.ps1 | Adds cached WinRM reachability helper for DCs. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ComputerSplit.ps1 | Adds helper to separate local vs remote computer targets. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ComputerADDomain.ps1 | Adds helper returning current AD domain via .NET. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ColumnChart.ps1 | Adds PScriboCharts column chart generator returning Base64. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-CimData.ps1 | Adds helper to retrieve CIM instances across local/remote computers. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrPKISection.ps1 | Adds introductory paragraph content to CA detail sections. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrForestSection.ps1 | Adjusts Forest heading and adds nested Sites/Infrastructure subsections. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDomainSection.ps1 | Reorganizes Domain section layout (Replication/GPO subsections; moves health checks). |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDiagrammer.ps1 | Adds diagram orchestration wrapper for supported diagram types and output formats. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDiagTrust.ps1 | Updates diagram helper function names and special-character sanitization calls. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDiagSiteInventory.ps1 | Updates diagram helper function names used for site inventory diagram. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDiagSite.ps1 | Updates diagram helper function names and special-character sanitization calls. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDiagReplication.ps1 | Updates replication diagram generation to new helpers and refines site/DC grouping. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDiagForest.ps1 | Updates diagram helper function names and special-character sanitization calls. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDiagCertificateAuthority.ps1 | Updates CA diagram helper function names. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDNSSection.ps1 | Adds explicit handling/messaging when CIM session is unavailable. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrDHCPinAD.ps1 | Adds “not found” narrative output when DHCP infra is absent. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADTrustInfo.ps1 | Updates trust diagram info helper function names. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADTrust.ps1 | Adds domain trust reporting section (table + optional diagram). |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADSitesInventoryInfo.ps1 | Updates site inventory info diagram helper function names. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADSitesInfo.ps1 | Adds sites + site link info collector used by diagrams. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADSite.ps1 | Updates embedded diagram section label key usage. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADSCCM.ps1 | Adds “not found” narrative output when SCCM infra is absent. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADReportBrief.ps1 | Adds a one-page report summary (overview/forest/domain/scope) and page break. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADReplicationInfo.ps1 | Adds replication connection inventory for replication diagram generation. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADOU.ps1 | Adds OU inventory + linked GPO + blocked inheritance reporting. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADKerberosAudit.ps1 | Adds Kerberos-focused security checks (delegation/KRBTGT/Administrator). |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADInfrastructureService.ps1 | Adjusts service health highlighting logic (adds DHCPServer critical flag). |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADGPO.ps1 | Refactors GPO section into inventory/settings/health subsections and adjusts headings. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADForestInfo.ps1 | Updates diagram helper function names for forest diagram info. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADFSMO.ps1 | Adds FSMO role reporting and best-practice check for infra master GC. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADDomainObject.ps1 | Renames/reorganizes directory objects section and nests account policies under a new heading. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADDomainLastBackup.ps1 | Adds domain last-backup reporting section calling WinAD helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADDomainController.ps1 | Updates memory health evaluation to use raw bytes instead of parsing formatted text. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADDomain.ps1 | Adds domain summary reporting including RID pool usage. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADDCRoleFeature.ps1 | Adjusts role/feature best-practice allowlist logic. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADDCDiag.ps1 | Adds DCDiag reporting table with impact/description mapping. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCaInfo.ps1 | Updates CA diagram info helper function names. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCATemplate.ps1 | Adds CA template inventory and optional ACL detail reporting. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCASummary.ps1 | Adds CA summary table section. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCASubordinate.ps1 | Adds subordinate CA details and auditing best-practice checks. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCASecurity.ps1 | Adds CA security sections (validity period, ACL/rights). |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCARoot.ps1 | Adds root CA details and auditing best-practice checks. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCAKeyRecoveryAgent.ps1 | Adds Key Recovery Agent certificate reporting for a CA. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCACryptographyConfig.ps1 | Adds CA cryptography configuration reporting. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADCAAIA.ps1 | Adds CA AIA URI configuration reporting. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ADObjectSearch.ps1 | Adds helper for subtree AD object lookup via Get-ADObject. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ADObjectList.ps1 | Adds LDAP DirectorySearcher-based object collection helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/Get-ADExchangeServer.ps1 | Adds Exchange server discovery via AD configuration partition. |
| AsBuiltReport.Microsoft.AD/Src/Private/Copy-DictionaryManual.ps1 | Adds dictionary deep-clone helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/ConvertTo-TextYN.ps1 | Adds “True/False → Yes/No” translation helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/ConvertTo-OperatingSystem.ps1 | Adds OS version/name normalization helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/ConvertTo-HashToYN.ps1 | Adds ordered-dictionary conversion helper using ConvertTo-TextYN. |
| AsBuiltReport.Microsoft.AD/Src/Private/ConvertTo-FileSizeString.ps1 | Adds bytes-to-unit (KB/MB/GB/TB/PB) formatting helper. |
| AsBuiltReport.Microsoft.AD/Src/Private/ConvertTo-EmptyToFiller.ps1 | Adds empty-to-“--” helper conversion. |
| AsBuiltReport.Microsoft.AD/Src/Private/ConvertTo-ADObjectName.ps1 | Adds DN-to-Name translation helper via remote AD lookup. |
| AsBuiltReport.Microsoft.AD/Src/Private/ConvertTo-ADCanonicalName.ps1 | Adds DN-to-CanonicalName translation helper via remote AD lookup. |
| AsBuiltReport.Microsoft.AD/Src/Private/ConvertFrom-DistinguishedName.ps1 | Adds DN parsing/conversion helper functions for multiple output shapes. |
| AsBuiltReport.Microsoft.AD/Src/Private/Convert-TimeToDay.ps1 | Adds helper to compute day differences between dates. |
| AsBuiltReport.Microsoft.AD/Src/Private/Convert-IpAddressToMaskLength.ps1 | Adds subnet mask to prefix-length conversion helper. |
| AsBuiltReport.Microsoft.AD/AsBuiltReport.Microsoft.AD.psm1 | Adds module loader that dot-sources public/private scripts and exports members. |
| AsBuiltReport.Microsoft.AD/AsBuiltReport.Microsoft.AD.psd1 | Updates required module dependencies (Chart 0.3.0; migrate to AsBuiltReport.Diagram 1.0.4). |
| AsBuiltReport.Microsoft.AD/AsBuiltReport.Microsoft.AD.json | Adds default report/options/healthcheck configuration JSON. |
| .github/workflows/Release.yml | Updates release workflow to install AsBuiltReport.Diagram and publish the module from the new subfolder. |
Comments suppressed due to low confidence (1)
AsBuiltReport.Microsoft.AD/Src/Private/Get-AbrADSCCM.ps1:82
- The catch blocks use
$_.SCCMception.Message, but the property should beExceptionon anErrorRecord. As written, this will log an empty message and can itself throw if$null.Messageis accessed. ReplaceSCCMceptionwithExceptionin these log statements.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <!-- ********** Update supported PowerShell versions ********** --> | ||
| | Windows PowerShell 5.1 | PowerShell 7 | | ||
| | :--------------------: | :----------------: | | ||
| | :white_check_mark: | :white_check_mark: | | ||
| | :x: | :white_check_mark: | | ||
|
|
There was a problem hiding this comment.
README now indicates Windows PowerShell 5.1 is not supported, but the module manifest still declares PowerShellVersion = 5.1 / CompatiblePSEditions = @('Desktop','Core'). Consider updating the manifest to require PowerShell 7+ (or clarify support in the README) so user expectations and installation prerequisites stay consistent.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| $TempReplInfo = [PSCustomObject]@{ | ||
| FromServer = $FromServer | ||
| ToServer = $ToServer | ||
| FromSite = $FromSite | ||
| ToSite = $ToSite | ||
| Domain = $Domain | ||
| AditionalInfo = $AditionalInfo | ||
| TransportProtocol = switch ([string]::IsNullOrEmpty($Conn.InterSiteTransportProtocol)) { |
There was a problem hiding this comment.
$Domain is referenced when building the output object, but this function no longer sets/loops a domain variable. This will emit Domain = $null (or error if strict mode) and makes the replication data ambiguous. Either remove the Domain property, or populate it from the connection/DC context (e.g., derive from $FromServer/$ToServer or reintroduce the per-domain loop).
| ### :arrows_clockwise: Changed | ||
|
|
||
| - Update module version to `0.9.12` | ||
| - Upgrade AsBuiltReport.Chart module to version `0.3.0` |
There was a problem hiding this comment.
The changelog states the module version was updated to 0.9.12, but the module manifest still declares ModuleVersion = '0.9.11'. Either bump the manifest version (recommended) or adjust the changelog entry so release notes match the shipped module version.
Report structure improvements