Daily Server Monitoring to ensure readiness and prevent disruptions
Monitoring Server Report, a comprehensive and modular PowerShell framework developed to automate daily health checks across all domains managed by the System Administrators team.
Designed for scalability, extensibility, and legacy support, the solution accommodates a broad spectrum of Windows Server environments, from legacy platforms like Windows Server 2003 to modern deployments such as Windows Server 2022. Its modular design enables seamless integration across heterogeneous infrastructures, ensuring consistent and reliable monitoring regardless of server age, role, or domain membership.
The system leverages dynamic logic to adapt to remote execution constraints, legacy compatibility, and varying security policies, making it suitable for both cloud-connected and isolated environments.
Objectives:
- Comprehensive Monitoring - Automate daily audits across key operational domains including memory, disk usage, CPU load, service status, certificate health, scheduled tasks, event logs, user access, antivirus status, time synchronization, and more.
- Secure Execution - Utilize PowerShell remoting with configurable execution policies and fallback logic for legacy systems, ensuring safe and controlled data collection.
- Structured Reporting - Generate timestamped HTML reports with optional visual charts, grouped by domain, server role, or health status, to enhance readability and facilitate decision-making.
- Modular Architecture - Built as a collection of discrete, reusable functions, the system supports rapid extension to new audit categories or infrastructure changes without disrupting existing workflows.
- Legacy Compatibility - Includes tailored logic for older systems, ensuring backward compatibility without sacrificing performance or reliability. Functions dynamically switch between WMI and CIM queries based on server capabilities.
- Security & Compliance Visibility - Track local users, remote access permissions, antivirus health, firewall status, and audit policy configurations to support compliance and reduce risk exposure.
- Operational Integrity - Monitor uptime, reboot history, pending restart flags, and backup job status to ensure systems remain stable, recoverable, and aligned with business continuity goals.
Core Components:
Server-main.ps1 - The main execution script. It reads the configuration, invokes the appropriate functions, aggregates results, and generates the final HTML report. This script coordinates the entire monitoring workflow.
- Orchestrates the entire monitoring process
- Loads configuration from Server-config.json
- Invokes modular functions from Server-functions.ps1
- Generates styled HTML reports using embedded logic and external CSS
- Manages output directories and file naming conventions
Server-functions.ps1 - Contains all PowerShell functions responsible for executing system checks. Each function is modular, reusable, and designed to operate across different server versions.
- Contains reusable PowerShell functions for each monitoring check
- Implements logic for CPU, memory, disk, services, backups, antivirus, and more
- Returns structured results for aggregation and reporting
Server-config.json - Defines the servers to monitor, services to check, and execution preferences. This file acts as the central configuration hub, allowing administrators to tailor the monitoring scope without modifying code.
- Defines which checks are enabled or disabled
- Defines which sections are collapsible
- Lists target servers and critical services
- Allows flexible customization without modifying script logic
HTML-style.css - Provides the visual styling for the HTML report. It ensures consistent formatting, color-coded status indicators, and responsive layout for easy viewing across devices.
- Provides visual styling for the HTML report
- Ensures readability, structure, and professional presentation
- Applies consistent formatting to tables, headers, and status indicators
Functions:
System & Hardware Inventory
- Get-ServerVersioInfo Retrieves OS version, architecture, install date, and hardware specs.
- Get-ServerMemoryInfo Audits total and available RAM.
- Get-ServerCPUInfo Collects CPU model, core count, clock speed, and load.
- Get-ServerDiskInfo Reports disk usage across all logical drives.
- Get-ServerAccessStatus Checks server reachability, remoting capability, and firewall status.
Security & Compliance
- Get-ServerCertificateInfo Audits installed certificates and expiration status.
- Get-ServerAntivirusStatus Checks Windows Defender and antivirus health.
- Get-ServerAuditPolicyAndLogSize Reviews audit policy and event log configurations.
- Get-ServerLocalUsersAndGroups Lists local users and their group memberships.
- Get-ServerRemoteAccessAudit Audits RDP and admin group access.
- Get-ServerLogonTracking Tracks recent successful and failed logon attempts.
- Get-ServerLoggedOnTracking Identifies currently logged-on users.
- Get-ServerOpenPorts Scans for open TCP/UDP ports.
- Get-ServerDNSHealthStatus Performs offline DNS resolution checks.
Services & Scheduled Tasks
- Get-ServerServiceStatus Audits service status and auto-start failures.
- Get-ServerScheduledTasks Reports scheduled task status and last run results.
Event Log Monitoring
- Get-ServerSystemEventReport Retrieves recent system-level warnings and errors.
- Get-ServerApplicationEventReport Retrieves recent application-level warnings and errors.
Uptime & Reboot Tracking
- Get-ServerUptimeAndRebootHistory Tracks uptime and reboot-related events.
- Get-ServerPendingRestartFlag Checks registry flags for pending restarts.
Network & Time Sync
- Get-ServerNetworkAndFirewallStatus Audits network configuration and firewall profiles.
- Get-ServerTimeSyncStatus Checks Windows Time Service and sync source.
Backup & Software Inventory
- Get-ServerVeeamBackupStatus Audits Veeam backup job status and last results.
- Get-ServerInstalledSoftware Lists installed applications and versions.
Output:
C:\Temp\HTMLReports\Server-main.ps1
Getting Windows Server Access Status ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 ...Querying OrclWin2016 ...Creating AccessPieChart Getting Windows Server Version ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Windows Server Memory ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 ...Creating MemoryPieChart Getting Windows Server CPU ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Windows Server Disks ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 ...Creating DiskPieChart Getting Windows LocalMachine Certificates ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Windows Server Services ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting last 25 System Warnings/Errors ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 |
Getting last 25 Application Warnings/Errors ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Scheduled Tasks Audit ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Windows Updates Status ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Local Users and Groups Audit ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Network Configuration and Firewall Status ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Antivirus Defender Health Status ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Audit Policy and Log Size Monitoring ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Uptime Report and Reboot History ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting RDP & Remote Access Config Audit ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 |
Getting Latest Logon Success/Failure p/User ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Current LoggedOn Users ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Windows Server Time Synchronization ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Veeam Backup Job Status ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Pending Restart Flag Status ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting list of Open Ports ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Performing Offline DNS Health Check ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 Getting Installed Software Inventory ...Querying SERVER1 ...Querying SERVER2 ...Querying SERVER3 ...Creating PDF |