Help Center

Monitor new(free) agents and add them to the group


The following powershell script let's you add agents which are not included in any group add to some specific group using the GroupID. You should filter agents using the regexp mask.

Script requires ResilioConnect.psm1 module placed near the script.

Before trying examples below, generate a valid API token in Settings -> API section

Examples:

1. Get the list of Groups using the monitor-new-agents.ps1 to get GroupID:

.\monitor-new-agents.ps1 -MC_host_and_port 192.168.1.209:8443 -API_token P5UAHTK6BS74DPV6VXDTOSYGO5VULNLO -GetGroups

2. To add all agents which names start with "ebdr-" pattern to group with GroupID = 388 use the following command:

.\monitor-new-agents.ps1 -MC_host_and_port 192.168.1.209:8443 -API_token P5UAHTK6BS74DPV6VXDTOSYGO5VULNLO -Mask "ebdr-*" -GroupID 388 -Run

Script will find all agents which are not included to any group and will add them to Group with ID 388.

3. To add the script to Windows schtasks which will automatically launch it every minute, you need to use -Install parameter like in the following example:

.\monitor-new-agents.ps1 -MC_host_and_port 192.168.1.209:8443 -API_token P5UAHTK6BS74DPV6VXDTOSYGO5VULNLO -Mask "ebdr-*" -GroupID 388 -Install

4. To remove the script from Windows schtaks:

.\monitor-new-agents.ps1 -Uninstall

 

Was the article helpful? Yes / No, send feedback on article Thanks!


Please note that we won't mail you back. This is just purely feedback on the article above. If you need help from our Support Team, please use the "Contact Support" link at the top of the page.