Scan-ADComputers.ps1 writes reports to reports/ad-computers by default, or to -OutputDirectory when supplied. The default run log is written under logs/scan-ad-computers/.
Scan-ADComputers.ps1 can export:
- Inventory data
- Targeted audit data
- Separate targeted status reports
- Summary reports
- Delta reports
- Optional performance summaries when
-PerformanceSummaryis supplied
Supported formats:
CsvJsonHtml
CSV exports are sanitized by default to reduce spreadsheet formula injection risk.
Use -DisableCsvSanitization only when raw values are required and the output
will not be opened in spreadsheet software.
Network output paths are rejected by default unless -AllowNetworkOutputPath is
supplied. Existing files are not overwritten unless -ForceOverwrite is supplied.
Manage-ADUserAccounts.ps1 writes reports to
reports/ad-user-accounts by default, or to
-OutputDirectory when supplied. The default run log is written under
logs/manage-ad-user-accounts/.
Network output paths are rejected by default unless -AllowNetworkOutputPath is
supplied. Existing report and log files are not overwritten unless -ForceOverwrite is supplied.
User list files from UNC paths are rejected unless -AllowNetworkInputPath is supplied.
File name pattern:
ADUsers_<ReportName>_<domain>_<timestamp>.<ext>
Common report names:
UserSummaryPasswordAgeLockedOutLockedOutEventsUserAuditSummaryUserAuditEventsAuditEventsPrivilegedUsersDisabledUsersStaleUsersResetActions
Common user fields:
SamAccountNameUserPrincipalNameDisplayNameEnabledLockedOutCreatedAccountAgeDaysPasswordLastSetPasswordAgeDaysPasswordAgeStatusPasswordNeverExpiresCannotChangePasswordLastLogonDateDaysSinceLastLogonLastBadPasswordAttemptAccountExpirationDateAdminCountDistinguishedNameObjectSIDObjectGUIDQueriedAt
Get-ADAdminActivity.ps1 writes a CSV report to -OutputCsv, or to
reports/ad-admin-activity by default. The default run log is written under
logs/get-ad-admin-activity/.
File name pattern:
AD_Admin_Activity_Report_<timestamp>.csv
Common fields:
TimeCreatedDomainControllerEventIdActionActorAccountActorSamAccountNameActorSidSubjectLogonIdTargetObjectTargetAccountMemberNameObjectDistinguishedNameAttributeNameOperationTypeAttributeValueEventRecordIdRenderedMessage
scripts/build_ad_excel_reports.py reads Scan-ADComputers.ps1 CSV or JSON exports and writes Excel reporting output under reports/<financial-year>/<run-date>/ by default. Logs are written under logs/excel-reporting/<financial-year>/<run-date>/ by default.
Output folders:
source: copies of the input scan exportsconsolidated: oneAD_Dashboard_<financial-year>_<run-date>.xlsxworkbookdepartments: one workbook folder per matched departmentlogs/excel-reporting/<financial-year>/<run-date>/unmatched_devices.csv: records that did not match a department
The reporting utility requires environment-local department runtime files:
config/dept_list.txtcopied fromconfig/dept_list.sample.txtconfig/dept_codes.txtcopied fromconfig/dept_codes.sample.txt
The runtime files are ignored by git so public clones get the samples without receiving environment-specific department data.
Excel detail sheets add normalized reporting fields near the front of each device record:
LastSeenDate: preserves a valid sourceLastSeenDatewhen present, otherwise uses sourceLastLogonDate, withLastLogonTimestampas a final fallback.InactivityDays: sourceDaysSinceLastSeenwhen present, otherwise calculated from the normalizedLastSeenDate.InactivityStatus:Staleat 90 days or more,Freshbelow 90 days, orUnknownwhen no usable source exists. SourceStaleStatus = Staletakes priority for this status.
Raw scan fields such as DaysSinceLastSeen, StaleStatus, and IsStale remain in the detail sheets later in the row for traceability.
For setup, quick start, usage, examples, and safety notes for each script, see:
- Main inventory:
<Servers|Workstations>_<domain>_<timestamp>.<ext> - Performance summary:
<Servers|Workstations>_<domain>_<timestamp>_Performance.csvand.json - Targeted audit:
<Servers|Workstations>_<domain>_<timestamp>_TargetedAudit.<ext> - Separate targeted status exports (when enabled):
_Matched_Unreachable_NotFoundInAD
ComputerTypeNameCNDNSHostNameDescriptionOUPathCanonicalNameDistinguishedNameCreatedEnabledIPv4AddressLastLogonDateLastLogonTimestampLastSeenDateDaysSinceLastSeenInactiveThresholdDaysIsStaleStaleStatusObjectGUIDOperatingSystemOperatingSystemVersionConnectivityMethodConnectivityStatusConnectivityReachableConnectivityDetailDnsStatusDnsResolvedIPsDnsMatchesAdIPv4PortStatusRemoteInventoryStatusRemoteUptimeDaysSerialNumberModelTotalMemoryGBSystemDriveFreeGBPendingRebootLoggedOnUserQueriedAt
The targeted input file is plain text:
- one host per line
- short name or FQDN under the discovered or supplied AD DNS suffix
- blank lines allowed
- comment lines starting with
#are ignored - names with invalid DNS characters are rejected
Example:
# Core production servers
Server01
sql01.domain.local
Server02