{"id":19454148,"url":"https://github.com/21bshwjt/activedirectory_replication_monitoring","last_synced_at":"2026-06-08T20:31:24.812Z","repository":{"id":108973907,"uuid":"293007425","full_name":"21bshwjt/ActiveDirectory_Replication_Monitoring","owner":"21bshwjt","description":"ActiveDirectory Replication Monitoring | HTML Email Alert","archived":false,"fork":false,"pushed_at":"2026-05-07T04:08:32.000Z","size":34,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-07T06:19:25.330Z","etag":null,"topics":["active-directory","iam","identity","monitoring","powershell"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/21bshwjt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-09-05T05:11:51.000Z","updated_at":"2026-05-07T04:08:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8526413-d2a9-43f3-8388-db4883fdceda","html_url":"https://github.com/21bshwjt/ActiveDirectory_Replication_Monitoring","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/21bshwjt/ActiveDirectory_Replication_Monitoring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21bshwjt%2FActiveDirectory_Replication_Monitoring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21bshwjt%2FActiveDirectory_Replication_Monitoring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21bshwjt%2FActiveDirectory_Replication_Monitoring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21bshwjt%2FActiveDirectory_Replication_Monitoring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/21bshwjt","download_url":"https://codeload.github.com/21bshwjt/ActiveDirectory_Replication_Monitoring/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21bshwjt%2FActiveDirectory_Replication_Monitoring/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34080025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["active-directory","iam","identity","monitoring","powershell"],"created_at":"2024-11-10T17:08:09.733Z","updated_at":"2026-06-08T20:31:24.805Z","avatar_url":"https://github.com/21bshwjt.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔁 Active Directory Replication Monitoring\n### HTML Email Alerts via PowerShell\n\n\u003e Proactively monitor AD replication health across your entire forest — get instant email alerts on failures, with full logging and Azure Monitor integration.\n\n---\n\n## 📋 Overview\n\nMaintaining healthy replication within an **Active Directory (AD) forest** is critical for every organization. This PowerShell solution automates replication health checks and delivers rich **HTML-formatted email alerts** the moment a replication error is detected — so your team can respond before users are impacted.\n\n---\n\n## ✨ Features\n\n- 📧 **HTML Email Alerts** — Beautiful, readable alert emails triggered automatically on replication errors\n- 📝 **Local Log Generation** — Tracks AD replication issues with date, time, and error codes for historical review\n- ☁️ **Azure Log Analytics Integration** — Forwards logs to Azure Monitor via the HTTP Data Collector API for centralized visibility\n- 🔐 **gMSA Support** — Designed to run securely under a Group Managed Service Account or standard Service Account\n\n---\n\n## ⚙️ Prerequisites\n\n| Requirement | Details |\n|---|---|\n| PowerShell | Version 5.1 or later |\n| Permissions | Normal AD user rights |\n| Service Account | gMSA or standard Service Account for Scheduled Task |\n| SMTP Server | Internal relay or external SMTP endpoint |\n\n---\n\n## 🚀 Setup\n\n### 1. Configure the Scheduled Task\n\nCreate a Windows Scheduled Task using a **Group Managed Service Account (gMSA)** or a standard Service Account to run the script on your desired interval.\n\n\u003e 📖 **Reference:** [Getting Started with Group Managed Service Accounts](https://docs.microsoft.com/en-us/windows-server/security/group-managed-service-accounts/getting-started-with-group-managed-service-accounts) — Microsoft Docs\n\n### 2. Update SMTP Variables\n\nBefore deploying, update the SMTP configuration block inside the script with your environment's mail relay settings:\n\n```powershell\n# ── SMTP Configuration ──────────────────────────────────────────\n$smtpServer   = \"smtp.yourdomain.com\"\n$smtpPort     = 587\n$mailFrom     = \"ad-monitor@yourdomain.com\"\n$mailTo       = \"it-alerts@yourdomain.com\"\n$mailSubject  = \"⚠️ AD Replication Error Detected\"\n# ────────────────────────────────────────────────────────────────\n```\n\n### 3. (Optional) Enable Azure Log Analytics\n\nTo ship replication logs to **Azure Monitor**, configure your Workspace ID and Shared Key in the script. Logs will be forwarded via the HTTP Data Collector API.\n\n\u003e 📖 **Reference:** [Send log data to Azure Monitor using the HTTP Data Collector API](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/data-collector-api?tabs=powershell) — Microsoft Docs\n\n---\n\n## 📂 Log Output\n\nEach script execution appends a structured log entry containing:\n\n- ✅ Timestamp (date \u0026 time)\n- 🖥️ Source \u0026 Destination Domain Controller\n- ❌ Error Code \u0026 Description\n- 🌐 Replication Partner Site\n\nLogs are stored locally and optionally forwarded to your **Azure Log Analytics Workspace** for querying with KQL.\n\n---\n\n## 📬 How It Works\n\n```\nScheduled Task triggers PowerShell script\n        │\n        ▼\nRun repadmin /showrepl or Get-ADReplicationFailure\n        │\n        ├── No errors found → Log \"Healthy\" entry, exit\n        │\n        └── Errors detected → Generate HTML email body\n                                      │\n                                      ├── Send alert email via SMTP\n                                      │\n                                      └── Write log entry (local + Azure Monitor)\n```\n\n---\n\n## 🤝 Contributing\n\nPull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.\n\n---\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F21bshwjt%2Factivedirectory_replication_monitoring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F21bshwjt%2Factivedirectory_replication_monitoring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F21bshwjt%2Factivedirectory_replication_monitoring/lists"}