Skip to content
Documentation
Updated 13 minutes to read
Markdown

The Nodinite Windows Server Monitoring Agent enables you to monitor, automate, and empower users with custom PowerShell scripts on your Windows Servers. With this feature, you can run scripts for advanced monitoring, automate routine tasks, and provide secure self-service actions for end-users—all from a single, unified platform.

✅ Execute virtually any PowerShell script for custom monitoring and automation
✅ Empower end-users to run scripts as Remote Actions on demand
✅ Centralize script management and execution for security and compliance

Built-in monitors (CPU, Memory, Disk, IIS) cover common infrastructure scenarios, but your business logic is unique. PowerShell monitoring bridges the gap between standard infrastructure monitoring and your specific integration requirements.

Common scenarios requiring custom scripts:

  • Integration health checks - Verify BizTalk orchestrations, message queues, or API endpoint availability
  • Business process validation - Check file drop locations, database record counts, or scheduled job completion
  • Compliance auditing - Validate security configurations, certificate expiration, or regulatory requirements
  • Custom application monitoring - Monitor line-of-business applications without native monitoring support
Monitoring Scenario Example Script Purpose State Evaluation
File System Check file age in drop folder, monitor file count Warning if files older than 2 hours
Database Query SQL Server for stuck transactions, row counts Error if transaction count exceeds threshold
Message Queues Check MSMQ queue depth, dead-letter queue Warning if queue depth > 1000 messages
APIs and Web Services Test REST API response time, validate endpoints Error if response time > 5 seconds
Business Rules Validate integration data completeness, check SLAs Warning if daily message count below expected
Certificates Check certificate expiration across multiple stores Warning 30 days before expiration

When to Use PowerShell vs Built-In Monitors

Section titled “When to Use PowerShell vs Built-In Monitors”
Use PowerShell When... Use Built-In Monitors When...
Monitoring custom applications or business logic Monitoring standard Windows infrastructure (CPU, Memory, Disk, IIS)
Checking integration-specific conditions (message queues, file drops) Tracking Windows Services, Event Logs, or Scheduled Tasks
Combining multiple checks in a single script Monitoring individual system components
Implementing remediation scripts via Auto Healing Using standard thresholds without custom logic
Validating business rules or compliance requirements Checking certificate expiration with standard thresholds

Key advantage: PowerShell scripts give you unlimited flexibility to monitor anything accessible via PowerShell cmdlets, .NET libraries, or external APIs.

flowchart LR A["fa Admin"]:::actor B["fa PowerShell Entry"]:::resource C["fa Windows Server Monitoring Agent"]:::agent D["fa Script Output"]:::output E["fa State
OK
Warning
Error
Unavailable"]:::state F["fa Remote Actions
Run Script / View Details"]:::action A --> | Configures | B B --> | Monitored by | C C --> | Evaluates | D D --> | Triggers | E E --> | Remote Actions | F classDef agent fill:#2678BD,stroke:#2E5C8A,stroke-width:2px,color:#000 classDef actor fill:#93d16d,stroke:#2E7D4E,stroke-width:2px,color:#000 classDef resource fill:#FFD525,stroke:#A67C00,stroke-width:2px,color:#000 classDef output fill:#c33d34,stroke:#8B2E2E,stroke-width:2px,color:#fff classDef state fill:#93d16d,stroke:#2E7D4E,stroke-width:2px,color:#000 classDef action fill:#2678BD,stroke:#2E5C8A,stroke-width:2px,color:#000

Diagram: PowerShell script monitoring flow — user/admin configures a script resource, the Nodinite Agent evaluates output and maps results to state, and Remote Actions enable execution and troubleshooting.

  • ✅ Multi server support: Execute scripts locally or remotely on any Windows Server with the Monitoring Agent installed.
graph LR subgraph "fa Nodinite" roNI["fa Windows Server Monitoring Agent"] --- | Local execution | roSRV1["fa Server A"] end subgraph "Other network" roNI --- | Remote execution | roSRV2["fa Server B"] end

This diagram illustrates how Nodinite executes PowerShell scripts both locally and remotely, enabling flexible monitoring and automation across your infrastructure.

This page outlines how Nodinite monitors the PowerShell Category using one or more role-based Monitor Views. You can configure state evaluation based on user-defined logic—globally or for specific scripts. Remote commands (Actions) are available to help you swiftly address reported problems. All implemented Remote Actions are detailed below.

PowerShell items as Resources
Example list of monitored 'PowerShell' resources in a Monitor View.

  • Administrators manually manage your PowerShell configurations. Sharing insights is easy with Monitor Views.
  • State Evaluation – Based on script output: Write-Warning for Warnings, Write-Error for Errors.
  • Category-based monitoring – Group monitored Resources by Categories for streamlined management.

State evaluation for PowerShell-based monitoring

Section titled “ State evaluation for PowerShell-based monitoring”

Nodinite displays each monitored PowerShell configuration as a Resources. For example, if you have 2 Windows Server configurations with 2 and 3 PowerShell scripts, you will have 5 'PowerShell' resources in Nodinite.

  • The Resources name matches the name of the PowerShell configuration.
  • The 'PowerShell' resource belongs to the following Category:
Category Description
PowerShell Ensure PowerShell configurations stay within user-defined monitoring thresholds

Categories
List of PowerShell-related resources in a Monitor View.

Each item (presented in Nodinite as a Resource) is evaluated with a state: OK, Warning, Error, or Unavailable.

You can reconfigure state evaluation at the Resources level using the Expected State feature.

Sync option
Option to force Nodinite to request a resynchronization with the Monitoring Agent.


For the PowerShell category, Nodinite evaluates the monitored state as described below:

State Status Description Actions
🚫 Unavailable Service not available The server can't be reached or evaluated due to network or security issues Review prerequisites
❌ Error Error state raised The script fails or contains Write-Error in the output Details
Show Action Scripts
⚠️ Warning Warning state raised The script failed or contains Write-Warning in the output Details
Show Action Scripts
✅ OK Operational The 'PowerShell' configuration is valid, and the script executes without any errors or warnings Details
Show Action Scripts

The following Remote Actions are available for the PowerShell Category:

PowerShell Remote Actions
Available remote actions for the PowerShell category.

View details for any PowerShell resource by clicking the Action button and selecting Details in the 'Control Center' section.

Details Menu Action
Open details modal using the 'Details' action.

Next, click the option to open the modal.

Details Modal
Example of the 'Details' modal.

Manage and execute scripts for any PowerShell resource by clicking the Action button and selecting Show Action Scripts in the 'Control Center' section.

Show Action Scripts Action
Open the scripts modal using the 'Show Action Scripts' action.

Next, click the option to open the modal.

Show Action Scripts Modal

Example of the 'Action Scripts' modal.

The scripts modal presents a script collection for the selected PowerShell resource. Key elements in the modal include:

  • Collection title and description — The modal header shows the collection name (for example, "PowerShell Script Collection Example") and an optional description beneath the Scripts section.
  • Refresh — A refresh control in the top-right to request an immediate update of the modal contents.
  • Scripts list — A table listing each script with columns for Name and Description, and an Execute button on the right for each entry.
  • Execute — Click Execute to run the script on the selected target; the user will be prompted to confirm intent before execution.
  • Output area — Script output appears at the bottom of the modal after execution.
  • Close — Use the Close button to dismiss the modal when finished.

Click the Execute button to run the script on demand.

Confirm intent
The user must confirm the intent to execute the script.

The output is presented at the bottom of the modal.

PowerShell Script Output
Example of the result from the operation.

Execute the first script in the collection immediately from the control menu without opening the full scripts modal. This is a quick-action for running the primary script assigned to the resource. Behavior:

  • Prompts the user to confirm the intent before executing.
  • Runs the script on the selected target and appends output to the same output area used by the scripts modal.
  • Use this action when you want to quickly run the top-priority script for the resource.

Execute first action
Execute the 'Execute first' action from the control center menu.

Execute the last script in the collection immediately from the control menu. This quick-action runs the bottom-most script in the configured script collection. Behavior:

  • Prompts the user to confirm the intent before executing.
  • Runs the script on the selected target and appends output to the same output area used by the scripts modal.
  • Use this action when you want to quickly run a secondary or cleanup script defined last in the collection.

Execute last action
Execute the 'Execute last' action from the control center menu.


Use Remote Configuration to manage PowerShell configuration.

Click the PowerShell tab to manage PowerShell monitoring options.
PowerShell tab
Example of the 'PowerShell' configuration tab.

State Example code Description
✅ OK echo "Hello World" Script runs without errors and has no warnings or errors written to the output
⚠️ Warning Write-Warning "Warning for moderate rain" Script runs without errors and has a warning written to the output
❌ Error Write-Error "General failure reading from disk" Script fails or has errors written to the output

Click the Add button to add a new entry. This will become the Resource as seen in Monitor Views.

This is the monitoring entry.

  • Enabled – When checked, this PowerShell Script is monitored
  • Display Name – The user-friendly name of this resource as provided to end-users within Monitor Views
  • Description – User-friendly description for the PowerShell Script resource
  • PowerShell Script – The script to use for monitoring
    PowerShell General tab
    Example of the PowerShell configuration General tab.

This entry allows the System Administrator to provide a script collection for end-users with permission to execute content as Remote Actions.
PowerShell User Script Collection tab
Example of the PowerShell User Script Collection tab.

Click the Add button for each script to include in the script collection.
User script entry
Example of a PowerShell User Script entry.

Set authentication options for executing the PowerShell script.
Authentication tab
Example of the PowerShell configuration Authentication tab.

Check the checkbox to execute the script on another target host.

  • Is remote server – When checked, these PowerShell Scripts run on a remote server.
    • Address – The address for the remote server.
  • Use authentication – When checked, authenticate to the remote server or impersonate a user locally via the username and password fields below.
    • Domain User – The name of the Windows user account. Format: DOMAIN\User.
    • Password – The password for the provided domain user.

Authentication fields
Example of the PowerShell configuration Authentication fields.


Below are practical examples demonstrating state evaluation and proper output formatting for common monitoring scenarios.

Returns a success message without warnings or errors:

Terminal window
# Monitor disk space - OK state
$drive = Get-PSDrive C
$freeSpaceGB = [math]::Round($drive.Free / 1GB, 2)
Write-Output "Drive C: has $freeSpaceGB GB free space available"

Expected State: ✅ OK

Triggers a warning when a threshold is approached:

Terminal window
# Monitor disk space - Warning when below 20%
$drive = Get-PSDrive C
$freeSpacePercent = [math]::Round(($drive.Free / $drive.Used) * 100, 2)
if ($freeSpacePercent -lt 20) {
Write-Warning "Drive C: is running low on space: $freeSpacePercent% free"
} else {
Write-Output "Drive C: has sufficient space: $freeSpacePercent% free"
}

Expected State: ⚠️ Warning (when below 20%)

Triggers an error when a critical threshold is exceeded:

Terminal window
# Monitor disk space - Error when below 10%
$drive = Get-PSDrive C
$freeSpacePercent = [math]::Round(($drive.Free / $drive.Used) * 100, 2)
if ($freeSpacePercent -lt 10) {
Write-Error "CRITICAL: Drive C: is critically low on space: $freeSpacePercent% free"
} elseif ($freeSpacePercent -lt 20) {
Write-Warning "Drive C: is running low on space: $freeSpacePercent% free"
} else {
Write-Output "Drive C: has sufficient space: $freeSpacePercent% free"
}

Expected State: ❌ Error (when below 10%)

Displays service status in a formatted table (demonstrates | Out-String):

Terminal window
# Monitor multiple Windows Services with table output
$services = @('W3SVC', 'WinRM', 'MSSQLSERVER')
$results = foreach ($serviceName in $services) {
$service = Get-Service -Name $serviceName -ErrorAction SilentlyContinue
if ($null -eq $service) {
[PSCustomObject]@{
Service = $serviceName
Status = 'NotFound'
State = 'Error'
}
Write-Error "Service '$serviceName' not found on this server"
} elseif ($service.Status -ne 'Running') {
[PSCustomObject]@{
Service = $serviceName
Status = $service.Status
State = 'Warning'
}
Write-Warning "Service '$serviceName' is not running (Status: $($service.Status))"
} else {
[PSCustomObject]@{
Service = $serviceName
Status = $service.Status
State = 'OK'
}
}
}
# Output table with proper formatting
$results|Format-Table -AutoSize|Out-String

Expected State: Varies based on service status (OK if all running, Warning/Error otherwise)
Key Point: | Out-String ensures the table displays correctly in Nodinite Web Client

Example 5: System Information with Out-String

Section titled “ Example 5: System Information with Out-String”

Retrieves system information with proper formatting:

Terminal window
# Monitor server uptime and basic info
$os = Get-CimInstance -ClassName Win32_OperatingSystem
$uptime = (Get-Date) - $os.LastBootUpTime
$info = [PSCustomObject]@{
ServerName = $env:COMPUTERNAME
'Uptime (Days)' = [math]::Round($uptime.TotalDays, 2)
'OS Version' = $os.Caption
'Free Memory (GB)' = [math]::Round($os.FreePhysicalMemory / 1MB, 2)
}
# Check if uptime is too long (e.g., > 90 days)
if ($uptime.TotalDays -gt 90) {
Write-Warning "Server has not been rebooted in $([math]::Round($uptime.TotalDays, 0)) days"
}
# Output formatted information
$info|Format-List|Out-String

Expected State: ⚠️ Warning (if uptime > 90 days)
Key Point: | Out-String formats object properties for readable output

Example 6: Multiple Checks with Combined States

Section titled “ Example 6: Multiple Checks with Combined States”

Performs multiple checks and combines state evaluation:

Terminal window
# Comprehensive server health check
$errorCount = 0
$warningCount = 0
# Check 1: CPU Usage
$cpu = Get-CimInstance Win32_Processor|Measure-Object -Property LoadPercentage -Average
if ($cpu.Average -gt 90) {
Write-Error "CPU usage is critically high: $($cpu.Average)%"
$errorCount++
} elseif ($cpu.Average -gt 70) {
Write-Warning "CPU usage is elevated: $($cpu.Average)%"
$warningCount++
}
# Check 2: Memory Usage
$os = Get-CimInstance Win32_OperatingSystem
$memoryUsedPercent = [math]::Round((($os.TotalVisibleMemorySize - $os.FreePhysicalMemory) / $os.TotalVisibleMemorySize) * 100, 2)
if ($memoryUsedPercent -gt 95) {
Write-Error "Memory usage is critically high: $memoryUsedPercent%"
$errorCount++
} elseif ($memoryUsedPercent -gt 85) {
Write-Warning "Memory usage is elevated: $memoryUsedPercent%"
$warningCount++
}
# Check 3: Critical Services
$criticalServices = @('W3SVC', 'WinRM')
foreach ($serviceName in $criticalServices) {
$service = Get-Service -Name $serviceName -ErrorAction SilentlyContinue
if ($null -eq $service -or $service.Status -ne 'Running') {
Write-Error "Critical service '$serviceName' is not running"
$errorCount++
}
}
# Summary output
$summary = [PSCustomObject]@{
'Server' = $env:COMPUTERNAME
'CPU Usage %' = $cpu.Average
'Memory Usage %' = $memoryUsedPercent
'Errors' = $errorCount
'Warnings' = $warningCount
}
$summary|Format-List|Out-String
if ($errorCount -eq 0 -and $warningCount -eq 0) {
Write-Output "All health checks passed successfully"
}

Expected State: Varies based on multiple conditions
Key Point: Demonstrates combining multiple checks with proper state evaluation and formatted output


...

Version:
Release date: N/A
Loading...

Explore Nodinite for 30 days – completely free

  • Find out why this is the leading O&M software
  • Prove your business case
  • Test the self-service for the business side

Loading...

See how Nodinite resolves your technical issues, in a LIVE Demo!

Once you submit this request:

  • We will give you a short call to understand the issues you want to tackle.
  • Understand solutions you have tried and why were you not happy with them.
  • Book a convenient slot for a LIVE demo!

Loading...