From ea711c712f5aaedeb2b340aa18d132cfd780bf88 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Tue, 21 Apr 2026 21:32:39 +1000 Subject: [PATCH] Add ConfigurationHandler (required by Disco plugin system) --- .../ADCompareConfigurationHandler.cs | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ConfigurationHandler/ADCompareConfigurationHandler.cs diff --git a/ConfigurationHandler/ADCompareConfigurationHandler.cs b/ConfigurationHandler/ADCompareConfigurationHandler.cs new file mode 100644 index 0000000..70a5b46 --- /dev/null +++ b/ConfigurationHandler/ADCompareConfigurationHandler.cs @@ -0,0 +1,50 @@ +using Disco.Data.Repository; +using Disco.Services.Plugins; +using System.Web.Mvc; +using System.Web.WebPages; + +namespace Disco.Plugins.ADCompare.ConfigurationHandler +{ + public class ADCompareConfigurationHandler : PluginConfigurationHandler + { + public override PluginConfigurationHandlerGetResponse Get(DiscoDataContext Database, Controller controller) + { + return Response(); + } + + public override bool Post(DiscoDataContext Database, FormCollection form, Controller controller) + { + // No configuration to save + return true; + } + } + + public class ConfigurationView : WebViewPage + { + public override void Execute() + { + WriteLiteral(@" +
+

AD Compare Plugin

+

This plugin compares the Managed By field on Active Directory computer objects + against the Assigned User in Disco ICT, and reports mismatches.

+
+

How It Works

+
    +
  • Loads all active devices from Disco that have a domain computer account
  • +
  • Looks up each computer in AD and reads the managedBy attribute
  • +
  • Resolves the managedBy Distinguished Name to a DOMAIN\username
  • +
  • Compares against Disco's AssignedUserId
  • +
  • Reports mismatches: different users, missing assignments, or empty managedBy
  • +
+
+

No configuration is required.

+

+ + Open Comparison Dashboard + +

+
"); + } + } +}