Skip to content

Add AD pre-population extractor for Dr Migrate#17

Draft
adamswbrown wants to merge 1 commit into
mainfrom
claude/ad-pre-population-extractor-JQmg2
Draft

Add AD pre-population extractor for Dr Migrate#17
adamswbrown wants to merge 1 commit into
mainfrom
claude/ad-pre-population-extractor-JQmg2

Conversation

@adamswbrown
Copy link
Copy Markdown
Owner

Summary

Implements the AD pre-population spec as a single read-only PowerShell script that pulls a complete server inventory, workload signals, and topology from Active Directory into CSVs ready to be merged into a DMC cloud-migration assessment.

The nine queries from the spec, plus a derived workload classification:

  • ad_servers.csv — authoritative enabled-server list (OS, last logon, OU, owner)
  • ad_spns_computer.csv — SPNs against computer objects
  • ad_spns_service_accounts.csv — SPNs against domain user accounts (catches SQL/Exchange/IIS running as service accounts)
  • ad_spns_gmsa.csv — SPNs against Group Managed Service Accounts
  • ad_workload_classification.csv — derived per-host workload hints from joined SPN data + reference table
  • ad_sites.csv, ad_subnets.csv — topology
  • ad_ou_distribution.csv — top-3-level OU counts
  • ad_stale_servers.csv — inactive past StaleThresholdDays (default 90)
  • ad_domain_controllers.csv — DCs (usually out of migration scope)
  • ad_coverage_summary.csv — single-row summary for the customer conversation
  • ad_run_status.csv — per-query status with row counts and any errors

Read-only; runs as any authenticated domain user. Logs to stderr so stdout stays clean. Each query is wrapped in try/catch — partial output is preferred over no output. Supports -Server, -Credential, -StaleThresholdDays, -TimestampOutput for snapshotting.

Test plan

  • Verify on a Windows 5.1 host with RSAT against a small lab domain
  • Verify on PowerShell 7.x (UTF8BOM encoding path)
  • Confirm stale-server filter respects -StaleThresholdDays
  • Confirm -TimestampOutput creates a dated subdirectory and re-runs don't clobber prior snapshots
  • Spot-check ad_workload_classification.csv against a known SQL host (workload should be derived from the service-account SPN, not the computer SPN)
  • Confirm gMSA query degrades gracefully on domains with no gMSAs (empty CSV, no error)

https://claude.ai/code/session_01Mv4u6bByTyy75mWPzod2Y4


Generated by Claude Code

Implements the nine queries from the AD pre-population spec as a single
read-only PowerShell script: master server inventory, computer + service
account + gMSA SPNs, sites, subnets, OU distribution, stale servers,
domain controllers, and a coverage summary. Adds a derived workload
classification CSV that joins all SPN sources against the service-class
reference table so SQL/IIS/Exchange/etc. workloads can be picked up
without scanning the servers.

https://claude.ai/code/session_01Mv4u6bByTyy75mWPzod2Y4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants