NinjaOne icon

NinjaOne

Consume NinjaOne API

Actions158

Management → Create Windows Event Policy Condition

AI-generated

Overview

This node enables creating a Windows Event Policy Condition within the Management resource of the NinjaOne API. It is designed to help automate the configuration of monitoring policies based on Windows event logs. Users can define specific event sources, event IDs, severity levels, notification channels, scripts to run, and other parameters that determine when and how alerts or actions should be triggered.

Practical scenarios include:

  • Automatically triggering alerts or remediation scripts when certain critical Windows events occur.
  • Defining granular conditions for event-based monitoring in IT infrastructure management.
  • Integrating with notification systems to inform teams about important system events.

Properties

Name Meaning
Policy Id Numeric identifier of the policy to which this condition will be added (required).
Enabled Boolean flag indicating if the policy condition is active.
Display Name Human-readable name for the policy condition.
Severity Severity level of the condition; options: NONE, MINOR, MODERATE, MAJOR, CRITICAL.
Priority Priority level of the condition; options: NONE, LOW, MEDIUM, HIGH.
Channels JSON array specifying notification channels for the condition.
Scripts JSON array defining scripts to run when the condition triggers, including runAs user and variables.
Notification Action Action to take for notifications; options: NONE, SEND.
Notify On Reset Boolean indicating whether to notify when the condition resets.
Reset Threshold Number of seconds defining the reset threshold for the condition.
Source String specifying the Windows event source (required).
Event Ids JSON array of event IDs to match (required).
Text JSON object defining text matching criteria with fields: values (array), condition (e.g., CONTAINS), include (e.g., ALL).
Occurrence JSON object defining occurrence settings with fields: enabled (boolean), threshold (number), duration (number).

Output

The node outputs an array of items where each item contains a json field representing the response from the NinjaOne API after creating the Windows Event Policy Condition. The structure of the JSON corresponds to the created policy condition details as returned by the API.

No binary data output is indicated for this operation.

Dependencies

  • Requires an API authentication token credential configured in n8n for the NinjaOne API.
  • The node uses the NinjaOne REST API endpoints under /v2/policies/{policyId}/condition/windows-event.
  • Proper permissions on the NinjaOne account to create or modify policy conditions are necessary.

Troubleshooting

  • Missing Required Fields: Errors may occur if required properties like Policy Id, Source, or Event Ids are not provided or invalid. Ensure these are correctly set.
  • Invalid JSON Format: Properties such as Channels, Scripts, Event Ids, Text, and Occurrence expect valid JSON strings. Malformed JSON will cause parsing errors.
  • API Authentication Failures: If the API key or OAuth2 credentials are missing or expired, requests will fail. Verify credential setup in n8n.
  • Permission Denied: Insufficient permissions on the NinjaOne account to create policy conditions will result in authorization errors.
  • Binary Data Errors: Not applicable here since this operation does not handle binary data.

Links and References

Discussion