AFTEC ↔ Entra Reconciliation (aftec-entra-recon)
Repeatable CLI tooling (Python, local workstation) that cross-checks PSI’s
systems of record for people. Repo: C:\git\aftec-entra-recon (local only —
not yet pushed to GHE).
reconcile.py — who exists where
Joins active AFTEC employees (UniData API) against enabled
Entra members (Graph), matching by employeeId → SAM → name. Classifies each
person as Both, AFTEC-only, or Entra-only, writes a timestamped
CSV + styled workbook to the Reports folder, and prints a delta vs the prior
run. Optional --timesheet corroborates AFTEC isActive with real labor
history (flags stale-active? / recently-departed?); it needs an on-prem AD
user token — cloud-only admins can’t open a UniData session.
dept_title_audit.py — how departments and titles are named (2026-08-19)
A master listing of departments and job titles across every naming surface, the groundwork for one canonical table and a future Paylocity reconciliation:
| Surface | What it contributes |
|---|---|
AFTEC employee dept | The bare numeric codes people are actually costed to (incl. legacy 110E/110M) |
| AFTEC COCE (cost-center master) | The ERP’s own dept naming (needs an on-prem AD token; skips gracefully) |
AFTEC TITLE | Sparse job titles (minority of employees) |
| Redbook routing slots | Known non-canonical naming (170 Quality, 102 Machine/Weld, 160Z) |
Entra department / jobTitle | The most complete title source |
AD department / title + dept OU | Independent AD naming, e.g. OU 170 - Information Technology vs attribute 170 - Operations |
Paylocity (--paylocity <csv>) | Optional; columns sniffed from headers |
Output: a 6-sheet workbook (Summary, Departments master, Department Variants, Job Titles grouped by normalized key, Title Variants, per-person People sheet with mismatch flags) + a per-person CSV.
The embedded canonical table has 18 codes; two names remain unresolved and the audit surfaces the live evidence for both:
- 170 — AD/Entra attribute says Operations, the AD OU says Information Technology, Redbook routes it as Quality.
- 135 — split between Customer Service and Customer Service / Field Service.
First run (2026-08-19): AFTEC 260 active / Entra 381 members / AD 399 enabled;
every dept value maps into the 18 canonical codes; 108 distinct normalized
titles; 12 people with cross-system dept conflicts, 47 with title conflicts
(mostly case-only, e.g. WELDER vs Welder).
Related
- UniData API — the AFTEC gateway both tools read
- psi-portal User Explorer / IT Ops person graph — the live web surface over the same identity joins