ee541d567f6df7c5c43db9a60edbaabd1158d695
Disco ICT - AD Compare Plugin
A plugin for Disco ICT that compares the Managed By field on Active Directory computer objects against the Assigned User in Disco, and reports mismatches.
What It Does
For every active device in Disco that has a domain computer account, this plugin:
- Looks up the computer in AD and reads the
managedByattribute - Resolves the
managedByDistinguished Name back to aDOMAIN\username - Compares that against Disco's
AssignedUserIdfor the device - Reports mismatches with clear reasons
Mismatch Categories
- Different users — Disco has one user assigned, AD
managedBypoints to someone else - Assigned in Disco but AD empty — Device is assigned in Disco but
managedByis blank in AD - Not assigned in Disco but AD set — No Disco assignment but
managedByis populated - Computer not found in AD — The device's domain ID doesn't resolve to an AD computer object
Web Dashboard
The plugin provides an in-app dashboard accessible via the Disco plugin web handler:
- Summary stats with colour-coded counts
- Filterable results table (mismatches only by default)
- Text search across serial numbers, computer names, and user IDs
- CSV export of all mismatches
Project Structure
├── ADComparePlugin.cs # Main plugin class
├── ConfigurationHandler/
│ └── ADCompareConfigurationHandler.cs # Required config handler + Razor view
├── Features/
│ └── DeviceCompareService.cs # Core comparison logic
├── Models/
│ └── DeviceComparisonResult.cs # Result models
├── WebHandler/
│ └── ADCompareWebHandler.cs # Dashboard, JSON API, CSV export
├── Properties/
│ └── AssemblyInfo.cs
├── Build-Plugin.ps1 # Build + package script
├── Disco.Plugins.ADCompare.csproj
└── README.md
Building & Packaging
Prerequisites
- Windows machine with Visual Studio or MSBuild
- The Disco ICT solution cloned and built
Steps
- Clone this repo alongside (or inside) the Disco solution directory
- Build the Disco solution first (so assemblies are available)
- Run the build script:
.\Build-Plugin.ps1 -DiscoSolutionPath "C:\Path\To\Disco"
This will:
- Compile the plugin against Disco's assemblies
- Generate a
manifest.json(using Disco's ManifestGenerator if available, or manually) - Package everything into a
.discoPluginfile (which is just a zip)
Installing
- In Disco ICT, go to Configuration > Plugins
- Click Install Plugin
- Upload the
.discoPluginfile - Restart Disco
- Navigate to the plugin dashboard to run comparisons
Requirements
- Disco ICT (compatible version)
- .NET Framework 4.7.2
- Active Directory connectivity from the Disco server
Description
Languages
C#
57.4%
PowerShell
42.6%