Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Редакция КоммитРедакция портала
commit 88ac4a6 · 15 days ago
Project

AD Inventory: accounting for the company's IT equipment — agent on PowerShell, a report in a single HTML file, and a web version with AD login

🌐 Machine-translated from Russian. Show original

AD Inventory — accounting for company computers: what hardware, what OS, who works, how much disk space, and what has changed since last time. Everything works within the company network — without internet, clouds, or external CDNs.

🔒 Since 17.11.2026, the source code of the AD Tools series is provided upon request: leave a request. The showcase of the series is github.com/WorkTime-kz/ad-tools.

A three-part package: the agent collects information about the computer, Lite creates one HTML file from reports, and the full version features a web interface with change history and manual accounting.

Link
📦Repository — agent, Lite, and full version

Список компьютеров в AD Inventory на демо-данных

In this part:

What's New (November 2026)#

Version 1.1.0. Briefly, what has changed since November 13:

  • 🔗 Connection with ad-onboarding. When hiring an employee, the hiring service reserves a free laptop or computer from the warehouse according to the job template, and upon dismissal, receives a list of equipment assigned to the employee for the checklist "pick up equipment." The computer card now has fields Status (in stock, reserved, issued, under repair, decommissioned) and Assigned to (login).
  • 🧩 Common ad-tools-core core: connection to AD, login, sessions, attempt limit, and log are now shared across the entire series. At the same time: logging in OTHER\ivanov or ivanov@other.local in the trusted forest is no longer counted in your ivanovaccount; exit revives the session, secret rotation and inactivity exit appeared; ldap:// without StartTLS — configuration error. After the update, users log in once again.
  • 🪟 Login via Kerberos — in the service itself via keytab or on the reverse proxy IIS/Apache. Status: verified on Samba AD; not tested on Windows Server AD or browsers yet. Disabled by default, login form always remains.
  • 🇰🇿 Kazakh interface. "RU / KAZ" switch on all screens; input and field validation errors, CSV export — in the user's language. Agent, Lite report, and machine APIs remain in Russian. Translation prepared using AI, edits by native speakers are welcome.
  • ⚙️ CI on GitHub Actions: tests in Ubuntu and Windows on Node 20 and 22, then run on the Samba AD test from ad-testlab (login, groups, computer unloading, check-ldap).
  • 🐞 Fix for running on Samba AD: missing attributes no longer become "undefined" (computer without DNS name, user without displayName — previously had an empty name).
  • 📌 The full version now requires Node.js 22+ (requirement ldapts 9.2).
  • 📦 The service can be installed together with the entire series with a single command — through ad-tools-suite.

Why#

Equipment accounting is often done manually in Excel and quickly becomes outdated: the disk was replaced, memory added, the laptop was relocated — the spreadsheet does not know this. But computers know everything about themselves: model, serial numbers, RAM, disks, monitors, OS. AD Inventory collects this information automatically, cross-checks it against the list of computers in Active Directory, and shows discrepancies: where the agent failed, which computer hasn't been in the domain for a long time, where disk space runs out.

How it works#

PartWhat does
Agent agent/collect.ps1Script for Windows PowerShell 5.1. Runs via GPO, collects computer information through CIM, and atomically writes <ПК>.json to a shared folder or sends a report over HTTPS
Lite lite/inventory-report.ps1One script without installation: collects reports from the folder into a single HTML file with search and filters and cross-checks them against computers in AD
Full version (Node.js)Web interface with AD login and access group: change history, inventory numbers and responsible persons, export to CSV, problematic PC tags,

Lite and the full version are independent and read the same folder: you can start with Lite and then install the full version.

Agent: what collects#

  • PC name, domain, manufacturer, model, serial number, UUID;
  • BIOS, processor, RAM by modules, physical drives (model, serial number, SSD/HDD, NVMe/SATA);
  • volumes: size and free space;
  • video cards, monitors with serial numbers (EDID via WmiMonitorID);
  • network adapters: MAC, IPv4/IPv6, gateway, DHCP;
  • OS: name, version, build, bit width, installation date, last boot;
  • last user and collection time;
  • optional (-Software) — installed software from the registry, without slow Win32_Product.

The agent does not install or hold services : at startup, it collects data, writes a single JSON file, and finishes. The collection only reads system information. The file is written atomically — through a temporary file and renaming with replacement, so Lite and the server will never read a half-written report.

Launch — via GPO: scheduler task as SYSTEM (recommended option), startup, or logon script. There are parameters -MaxDelaySec (random delay so that all PCs don't write simultaneously in the morning) and -MinHours (do not collect more than once every N hours).

The reports folder is configured so that domain computers can only create and overwrite their own files, but cannot read others' files or even see the file list: reports contain serial numbers, MAC addresses, and user names. NTFS permission table — in the instructions.

Full version: what he can do#

  • 📥 Report sources: reads the shared folder and/or accepts reports over HTTPS (tokenPOST /api/report ).
  • 🕓 Change history: RAM, disk, processor, monitor, MAC, BIOS, or OS changed — the entry "was → became" with a date. Separately — installed and removed software. Monthly Windows updates do not appear in the history.
  • ✍️ Manual accounting: inventory number, responsible, placement, note, condition (in stock, reserved, issued, under repair, written off), and "assigned to". Each edit is logged into the author's login history.
  • 🔗 Integration API for ad-onboarding: reserve a free laptop or computer for a new employee (repeating does not create a second reserve) and a list of equipment for the departing employee. Access is by token, each call is recorded in a separate log.
  • 🚩 Notes: low system disk space, old OS, no report for a long time, recent changes. Thresholds are set in the settings.
  • 🔄 Reconciliation with AD: the computer is in AD but no report; the report is present, but the computer is not in AD; disabled in AD; has not been logged into the domain for a long time.
  • 🔍 Search by name, inventory number, responsible person, model, serial number, user, IP, and MAC in any format, with layout corrections. Filters by elevations, OS, and manufacturer, selection links can be forwarded.
  • 📤 CSV for Excel (UTF-8 with BOM, separator ;) — the current sample or the entire account.
  • 🔐 Login via domain password or via Kerberos (optional), access group, and separate editor group (nested groups are considered).
  • 🇰🇿 Interface in Russian and Kazakh — switch "RU / ҚАЗАҚ".
  • 🩺 GET /healthz for monitoring (Zabbix, PRTG) and npm run check-ldap for diagnosing AD connectivity.

Security and simplicity: strict CSP, no external scripts or fonts, one dependency — ldapts. Connection to AD (multiple controllers, only LDAPS/StartTLS), login parsing with trusted domain login protection, sessions, attempt limit, and log — all from the common core of the ad-tools-core series. No database needed: storage — JSON file on the computer.

Where it takes place:

PlatformHow
Windows ServerWindows Service (WinSW)
Linuxthe systemd service, the reports folder is mounted via CIFS
Dockerdocker compose up -d --build
HTTPSembedded (PFX) or via nginx or IIS

Requirements: Node.js 22+ or Docker; workstations — Windows with PowerShell 5.1.

Lite: serverless report#

Don't want to install a server? Lite is a single script inventory-report.ps1 without settings or passwords. It collects all reports from the folder into one HTML file with search, filters, dropdown cards, and export to CSV, adds computers from AD, and marks discrepancies: "No report," "Long time not logged into AD," "Not in AD," "Disabled in AD," as well as "Low space," "Old OS," and "Long time no report."

powershell -ExecutionPolicy Bypass -File .\inventory-report.ps1 -InventoryPath \\fs01\inventory$

To have the report update automatically, run as administrator:

.\inventory-report.ps1 -InventoryPath \\fs01\inventory$ -OutFile \\fs01\it$\Оборудование.html -Install -EveryMinutes 60

The script will create a scheduler task on behalf of SYSTEM. Parameters (all optional): -SearchBase — only the required OU, -NoAD — without reconciling with AD, -Software — with software lists, thresholds -LowDiskPercent, -LowDiskGB, -StaleDays, -AdActiveDays, -OldOsMinBuild, -Demo — view without AD.

⚠️ HTML contains information about all computers — put it where only IT can see it.

Quick start: demo without AD#

Full version (required Node.js 22+):

npm ci
npm run demo        # http://localhost:8080, вход demo / demo

The demo includes 63 test computers with change history and all types of marks.

Lite in Windows PowerShell 5.1:

.\lite\inventory-report.ps1 -Demo
start .\lite\inventory-report.html

Agent on your computer — only show JSON without writing anything:

.\agent\collect.ps1 -Print -Software

For combat installation, the repository has detailed instructions (docs/INSTALL.md): shared folder and its permissions, running the agent via GPO, service account, LDAPS validation, installation on Windows Server, Linux, and Docker, DNS name and HTTPS, login and groups, login via Kerberos (SPN, keytab, GPO for browsers), receiving reports via HTTPS, operation, trouble table, security checklist, and linking with ad-onboarding.

Project status#

  • GPL-3.0 license; source code is available upon request.
  • 50 autotests: parsing and checking reports, change history, markups, search, CSV, integration APIs, Kerberos, ru/kkdictionaries, kernel integrity, as well as server integration tests — login, CSRF protection, token report acceptance. In Windows, tests run a real agent and verify that the server accepts its report. In CI — Ubuntu and Windows, Nodes 20 and 22.
  • The demo is verified in the browser, Lite — on demo data and on a real report from a single computer without AD.
  • Computer unloading and login are checked on a real Samba AD controller ( ad-testlab stand) with each change: computers OU, OS, version, DNS name, disabled.
  • Not yet tested in a combat environment: working with Windows Server AD, NTFS/SMB rights on a real file server, running the agent via GPO, reconciling with AD in Lite, Windows/systemd and Docker services with CIFS, receiving reports via HTTPS with a real certificate. Therefore, we are looking for administrators willing to try it on our own.

How to help#

  • ⭐ Give a star to the ad-tools showcase if the project is useful.
  • 🧪 Try it on your domain — start with a demo, collect.ps1 -Print , and npm run check-ldap — and write in the comments what worked and what didn't.
  • 🛠️ Questions and access requests — through the Issues storefront; after gaining access, send issues and pull requests to the service repository.

👉 Repository: source code — upon request, leave a request. Series showcase — github.com/WorkTime-kz/ad-tools

Looking for:тестировщики с реальным ADконтрибьюторыобратная связь от админов
Comments 01 участник · 0 гостей🔒 Rate and discuss after signing up

Comments · 0

No comments yet.Sign in to comment, rate and see all comments.