Update README for device managedBy comparison focus
This commit is contained in:
@@ -1,67 +1,80 @@
|
|||||||
# Disco ICT - AD Compare Plugin
|
# Disco ICT - AD Compare Plugin
|
||||||
|
|
||||||
A plugin for [Disco ICT](https://github.com/garysharp/Disco) that compares Active Directory user details against Disco's stored records to identify mismatches.
|
A plugin for [Disco ICT](https://github.com/garysharp/Disco) that compares the **Managed By** field on Active Directory computer objects against the **Assigned User** in Disco, and reports mismatches.
|
||||||
|
|
||||||
## What It Does
|
## What It Does
|
||||||
|
|
||||||
This plugin provides:
|
For every active device in Disco that has a domain computer account, this plugin:
|
||||||
|
|
||||||
- **Full Comparison** — Iterates all Disco users and looks them up in AD, comparing core fields
|
1. Looks up the computer in AD and reads the `managedBy` attribute
|
||||||
- **Mismatch Detection** — Identifies differences in Display Name, Surname, Given Name, Email, and Phone Number
|
2. Resolves the `managedBy` Distinguished Name back to a `DOMAIN\username`
|
||||||
- **AD Status Checks** — Flags users not found in AD or with disabled AD accounts
|
3. Compares that against Disco's `AssignedUserId` for the device
|
||||||
- **Web Dashboard** — In-app UI with filtering, searching, and summary stats
|
4. Reports mismatches with clear reasons
|
||||||
- **CSV Export** — Download comparison results for reporting
|
|
||||||
- **Detail Provider** — Stores comparison metadata as UserDetails for other plugins to consume
|
|
||||||
- **Photo Sync** — Pulls `thumbnailPhoto` from AD for user photos
|
|
||||||
|
|
||||||
## Fields Compared
|
### Mismatch Categories
|
||||||
|
|
||||||
| Disco Field | AD Attribute |
|
- **Different users** — Disco has one user assigned, AD `managedBy` points to someone else
|
||||||
|-----------------|--------------------|
|
- **Assigned in Disco but AD empty** — Device is assigned in Disco but `managedBy` is blank in AD
|
||||||
| DisplayName | displayName |
|
- **Not assigned in Disco but AD set** — No Disco assignment but `managedBy` is populated
|
||||||
| Surname | sn |
|
- **Computer not found in AD** — The device's domain ID doesn't resolve to an AD computer object
|
||||||
| GivenName | givenName |
|
|
||||||
| EmailAddress | mail |
|
## Web Dashboard
|
||||||
| PhoneNumber | telephoneNumber |
|
|
||||||
|
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
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
Disco.Plugins.ADCompare/
|
├── ADComparePlugin.cs # Main plugin class
|
||||||
├── ADComparePlugin.cs # Main plugin class
|
├── ConfigurationHandler/
|
||||||
|
│ └── ADCompareConfigurationHandler.cs # Required config handler + Razor view
|
||||||
├── Features/
|
├── Features/
|
||||||
│ ├── ADCompareDetailsProvider.cs # DetailsProviderFeature implementation
|
│ └── DeviceCompareService.cs # Core comparison logic
|
||||||
│ └── ADCompareService.cs # Core comparison logic
|
|
||||||
├── Models/
|
├── Models/
|
||||||
│ └── UserComparisonResult.cs # Comparison result models
|
│ └── DeviceComparisonResult.cs # Result models
|
||||||
├── WebHandler/
|
├── WebHandler/
|
||||||
│ └── ADCompareWebHandler.cs # Web UI and API endpoints
|
│ └── ADCompareWebHandler.cs # Dashboard, JSON API, CSV export
|
||||||
├── Properties/
|
├── Properties/
|
||||||
│ └── AssemblyInfo.cs
|
│ └── AssemblyInfo.cs
|
||||||
|
├── Build-Plugin.ps1 # Build + package script
|
||||||
├── Disco.Plugins.ADCompare.csproj
|
├── Disco.Plugins.ADCompare.csproj
|
||||||
└── README.md
|
└── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
## Web Handler Endpoints
|
## Building & Packaging
|
||||||
|
|
||||||
| Action | Description |
|
### Prerequisites
|
||||||
|----------------|-------------------------------------------------|
|
|
||||||
| `Index` | Dashboard page with comparison UI |
|
|
||||||
| `Compare` | Runs full comparison, returns JSON |
|
|
||||||
| `CompareUser` | Compare single user (`?userId=DOMAIN\username`) |
|
|
||||||
| `Export` | Download results as CSV |
|
|
||||||
|
|
||||||
## Building
|
- Windows machine with Visual Studio or MSBuild
|
||||||
|
- The Disco ICT solution cloned and built
|
||||||
|
|
||||||
This plugin needs to reference the Disco ICT assemblies (`Disco.Models.dll`, `Disco.Data.dll`, `Disco.Services.dll`). Adjust the HintPaths in the `.csproj` to point at your local Disco build output, or add as ProjectReferences if building within the Disco solution.
|
### Steps
|
||||||
|
|
||||||
## Installation
|
1. Clone this repo alongside (or inside) the Disco solution directory
|
||||||
|
2. Build the Disco solution first (so assemblies are available)
|
||||||
|
3. Run the build script:
|
||||||
|
|
||||||
1. Build the project to produce `Disco.Plugins.ADCompare.dll`
|
```powershell
|
||||||
2. Place the DLL in the Disco plugins directory
|
.\Build-Plugin.ps1 -DiscoSolutionPath "C:\Path\To\Disco"
|
||||||
3. Restart Disco ICT
|
```
|
||||||
4. Navigate to the plugin configuration in Disco's admin panel
|
|
||||||
5. Click "Run Full Comparison" to see results
|
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 `.discoPlugin` file (which is just a zip)
|
||||||
|
|
||||||
|
### Installing
|
||||||
|
|
||||||
|
1. In Disco ICT, go to **Configuration > Plugins**
|
||||||
|
2. Click **Install Plugin**
|
||||||
|
3. Upload the `.discoPlugin` file
|
||||||
|
4. Restart Disco
|
||||||
|
5. Navigate to the plugin dashboard to run comparisons
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user