Custom Actions in RdpGuard. How to send an e-mail when IP address is blocked/unblocked.
RdpGuard
Intrusion prevention system for your Windows Server
 

Custom Actions in RdpGuard

Custom Actions Overview

Custom actions let RdpGuard send email and Telegram notifications, call HTTP endpoints or run scripts when an event occurs. For example, send an email when an IP address is blocked or a user logs in.

Administrator privileges are required to configure or test custom actions because they can run programs with SYSTEM privileges. For details, see the Custom Actions security fix.

Events

The following Custom Action Events are supported:

Event Triggered
IP Blocked Each time RdpGuard blocks an IP address
IP Unblocked Each time RdpGuard unblocks an IP address
User Logged In Each time the user logs in
Failed Login When an enabled protection module detects a failed login, subject to the action's event settings
New Version Available Each 24 hours if you are not using the most recent RdpGuard release
Maintenance is about to expire Each 24 hours if your maintenance period ends in less than 30 days
Maintenance Expired Each 24 hours if your maintenance period is over

IP Blocked and IP Unblocked actions apply to locally detected attempts. Blocking an address solely through IP Cloud does not trigger these events.

Custom Actions

The following Custom Actions are supported:

Variables

You can use the following variables in E-mail Subject/Body, HTTP POST Endpoint/Body, Telegram messages or as arguments for program execution:

  • %IP% - IP address
  • %USER% - User name
  • %DOMAIN% - Windows Domain
  • %BLOCK_DATE% - Block date and time in the server's local time zone
  • %UNBLOCK_DATE% - Unblock date and time in the server's local time zone
  • %BLOCK_DATE_UTC% - Block date and time in UTC (ISO 8601)
  • %UNBLOCK_DATE_UTC% - Unblock date and time in UTC (ISO 8601)
  • %PROTOCOL% - Protocol (reason)
  • %TOTAL_IP_BLOCKED% - Total IP addresses currently blocked
  • %HOSTNAME% - The host name of the computer where RdpGuard installed
  • %NEW_VERSION_NUMBER% - New version number
  • %NEW_VERSION_LINK% - New version download link
  • %MAINTENANCE_DAYS% - Maintenance days remaining

The UTC variables use the fixed ISO 8601 format yyyy-MM-ddTHH:mm:ssZ, for example 2026-09-14T09:30:00Z. The trailing Z means UTC. This format does not depend on the server's regional settings. The existing %BLOCK_DATE% and %UNBLOCK_DATE% variables keep their local time and regional date/time format.

Both unblock date variables represent the scheduled automatic unblock time.

Supported Custom Actions

Send E-mail

Send Email Settings
Send Email Settings

This custom action allows you to send an e-mail using pre-defined SMTP server

The following configuration fields are available:

SMTP Server - use this drop-down list to specify SMTP server to use for sending e-mails.

You can add/edit SMTP servers using the ... button next to the drop-down list.

From - specify the sender's email address

To - specify the recipient's email address

Subject - specify message subject, you can use variables described above.

Body - specify message body, you can use variables described above.

Send HTTP Post

Send HTTP POST Settings
Send HTTP POST Settings

This custom action performs HTTP POST request to user defined endpoint each time the event occur.

The following configuration fields are available:

Endpoint - specify the endpoint the request will be sent to, you can also specify the port after the server name using the colon symbol, for example https://server.com:443/page.aspx

Enable Basic HTTP Authentication - use this option to enable password protected access to the endpoint. Please note that username/password is transmitted in plain form for this kind of authentication, so TLS/SSL connection is recommended if you enable this option.

Username - user name for Basic HTTP Authentication

Password - password for Basic HTTP Authentication

POST Body - specify the HTTP POST body you would like to receive on the server side, you can use variables described above.

Execute program

Execute Program Custom Action Settings
Execute Program Custom Action Settings

Run a program or script when the selected event occurs.

The following configuration fields are available:

Program/script - Specify the program or script to execute

Arguments - Specify program arguments, you can use variables described above.

Timeout (seconds) - Set a timeout in seconds; 0 means no limit.

Terminate program on timeout - Enable this option to have RdpGuard attempt to stop the program when the timeout expires. Otherwise, RdpGuard logs the timeout and waits for the program to exit.

Up to 8 programs can run at once. Other custom actions use a separate queue, so slow programs do not hold up notifications.

Report to AbuseIPDB

Report to AbuseIPDB Custom Action Settings
Report to AbuseIPDB Custom Action Settings

Report blocked IP addresses to AbuseIPDB. This action is available only for the IP Blocked event.

The following configuration fields are available:

API key - enter your AbuseIPDB API key

Send Telegram Message

Send Telegram Message Custom Action Settings
Send Telegram Message Custom Action Settings

This custom action allows you to send a message to a Telegram chat or channel.

The following configuration fields are available:

Please follow the instructions to create a Telegram Bot and get the Bot Token.

To make a chat appear in the drop-down list, start a chat with the bot, then click Get chats.

To add Custom Action

  1. Click Tools, Custom Actions/Notifications

    Click Tools, Custom Actions/Notifications
    Click Tools, Custom Actions/Notifications

    The Custom Actions dialog will open:

    Custom Actions dialog
    Custom Actions dialog
  2. Click Add (or press Ins)

    The Add New Custom Action dialog will open:

    Add New Custom Action dialog
    Add New Custom Action dialog
  3. Select the Event:

  4. Select the Task.

  5. Configure Custom Action

  6. Click Add action, then click Save changes in the Custom Actions dialog.

To edit Custom Action

  1. Click Tools, Custom Actions/Notifications

    Click Tools, Custom Actions/Notifications
    Click Tools, Custom Actions/Notifications

    The Custom Actions dialog will open:

    Custom Actions dialog
    Custom Actions dialog
  2. Select Custom Action you would like to edit and click Edit (or press F2)

    The Edit Custom Action dialog will open:

    Edit Custom Action dialog
    Edit Custom Action dialog
  3. Edit Custom Action parameters

  4. Click Save changes in the editor, then again in the Custom Actions dialog.

To temporarily disable an action, clear its checkbox in the table and click Save changes.

To delete Custom Action

  1. Click Tools, Custom Actions/Notifications

    Click Tools, Custom Actions/Notifications
    Click Tools, Custom Actions/Notifications

    The Custom Actions dialog will open:

    How to Delete Custom Actions
    How to Delete Custom Actions
  2. Select custom actions you would like to delete and click Delete (or press Del)

  3. Click Save changes in the Custom Actions dialog.

Custom Action Event Settings

The Failed Login and User Logged In events have additional settings.

Failed Login

Use Failed Login to receive a notification or run a script when RdpGuard detects a failed login, without waiting for the IP address to reach the blocking threshold.

Add a custom action, choose Failed Login in the event list and click Configure... beside it.

Choose Failed Login and click Configure...
Choose Failed Login and click Configure...

The Event settings dialog opens:

Example settings for Failed Login notifications.
Example settings for Failed Login notifications.

Protocols: Choose All protocols (the default) or Selected protocols and select the protocols to include. Only enabled protection modules generate events; their detection exclusions still apply.

Include other detected threats - Enable this option to include HTTP scans, SMTP spam or relay attempts, SQL probes and other detections in addition to failed logins.

Ignore attempts from whitelisted IP addresses - Enable this option to skip attempts from addresses on your whitelist. It is off by default, so you can receive alerts for whitelisted addresses too.

Exclusion rules: Enter one exclusion rule per line. For example, TargetUserName=backup-service skips attempts for that account. Rules can use IpAddress, TargetUserName, TargetDomainName and Protocol. If any rule matches, this action is skipped; blocking rules are unchanged. See the exclusion rules syntax.

Limit repeated notifications - Enable this option and choose an interval in seconds or minutes. The first matching attempt triggers the action immediately; further attempts from the same IP address on the same protocol are suppressed for that interval. The limit applies separately to each action. With this option off, every matching attempt triggers the action.

Click Save changes, configure the notification or script, then save the action and the Custom Actions list. Messages can include %IP%, %USER%, %PROTOCOL% and %HOSTNAME%.

User Logged In

To configure successful-login notifications, add a custom action, choose User Logged In and click Configure... beside the event list.

User Logged In event settings link
User Logged In event settings link

The Exclusion rules for successful logins dialog will open:

Exclusion rules for successful logins
Exclusion rules for successful logins

Here exclusions for Successful Logins can be configured, please refer to the Exclusion Rules Syntax for more details about the rules syntax.

RdpGuard 10.4.5 Free Trial

RdpGuard protects:

Our customers say

"This sotware is really great. It's a relief. Because my server is constantly under attack. Thanks RdpGuard" - Joaquim De Sousa Marques

"Nice product. I used to implement something similiar in a low-tech and cumbersome manner via a script called TSBlock (not mine). This makes it much easier and is well worth the pricetag for SMB's." - J. Johnson

"Absolutely amazed at your product. We are a church in the North Dallas area, and I discovered this morning multiple failed logon attempts via our Remote Access Server. A friend suggested your product, so I immediately downloaded the trial. It had a list of about five blocked IP addresses in minutes, and that was enough to lead me to push the BUY button. Over the past 10-15 minutes the list is now about thirty with at least a third being international attempts to break into our system. Thanks for a great product. You may have just saved us much grief." - John Hallford

"Love the software. RDP on our Windows servers is just ridiculous. We would block it in the router but we have lots of old-time customers that would have issues." - Scott Hirsch

"Love the software! Makes it easier than tailoring VB Scripts!!" - Nick Brennan

"It's a great product - really stopping those RDP attackers :-)" - Dave, UK

"First of all: Your application is very (!!!) useful and I like it very much securing my 2012 R2 server. RdpGuard is the best solution, I found on the market and after 10 minutes of testing it I ordered the fully-featured version. :-)" - Carsten Baltes

Our Other Products
Copyright © 2012-2026 Netsdk Software FZE. All rights reserved.  Terms of Use.  Privacy Policy.  Refund Policy.