<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Add loop task to enable or disable host monitoring in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/248620#M1627</link>
    <description>&lt;P&gt;Hi team,&lt;/P&gt;
&lt;P&gt;I want to use loop task for a list of hosts to enable or disable monitoring in Dynatrace. I would like to have multiple hosts to be executed with single workflow for http_request.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[
{
"externalId": "string",
"schemaId": "builtin:host.monitoring",
"schemaVersion":"1.4",
"scope": "HOST-7AA30C2D50D93E12",
"value": {
"enabled": false
}
}
]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Dec 2025 12:14:31 GMT</pubDate>
    <dc:creator>Smalhotra89</dc:creator>
    <dc:date>2025-12-15T12:14:31Z</dc:date>
    <item>
      <title>Add loop task to enable or disable host monitoring</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/248620#M1627</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;
&lt;P&gt;I want to use loop task for a list of hosts to enable or disable monitoring in Dynatrace. I would like to have multiple hosts to be executed with single workflow for http_request.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[
{
"externalId": "string",
"schemaId": "builtin:host.monitoring",
"schemaVersion":"1.4",
"scope": "HOST-7AA30C2D50D93E12",
"value": {
"enabled": false
}
}
]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Dec 2025 12:14:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/248620#M1627</guid>
      <dc:creator>Smalhotra89</dc:creator>
      <dc:date>2025-12-15T12:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/248687#M1636</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/77190"&gt;@Smalhotra89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes this is possible with the loop task. Before you start you need to generate an "Access Token" with the scopes&amp;nbsp;"Read settings" and "&lt;SPAN&gt;Write settings".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Then you can start creating the workflow. First you need to fetch all settings objects for the list of hosts you want to disable or enable with a http request task. The list of hosts is put in the URL and is comma separated. In the header section you add the Autorization details,&amp;nbsp;please have a look at following screenshot&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sinisa_zubic_0-1718814871834.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20639i73A91FA5EE0C5E91/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sinisa_zubic_0-1718814871834.png" alt="sinisa_zubic_0-1718814871834.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;in the subsequent http request task you need to configure the loop task like this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sinisa_zubic_1-1718814949557.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20640iF35852137BAF1CEE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sinisa_zubic_1-1718814949557.png" alt="sinisa_zubic_1-1718814949557.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The input for the tasks should be that&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sinisa_zubic_2-1718815087103.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20641i8B742F7757AA46C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sinisa_zubic_2-1718815087103.png" alt="sinisa_zubic_2-1718815087103.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this approach you have to create the token and manage it yourself.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you could also do the same thing with a javascript task with custom javascript code, the benefit there would be that you don't need to create a token for changing the settings. Since the used sdks underneath managed this for you.&lt;/P&gt;
&lt;P&gt;this is the snippet for the javascript task&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// optional import of sdk modules
import { execution } from '@dynatrace-sdk/automation-utils';
import { actionExecution } from "@dynatrace-sdk/automation-utils";

import { SettingsObject, settingsObjectsClient } from "@dynatrace-sdk/client-classic-environment-v2";

export default async function ({ execution_id, action_execution_id }) {
  // your code goes here
  // e.g. get the current execution
  const ex = await execution(execution_id);
  const actionEx = await actionExecution(action_execution_id);
  const scopes = actionEx.loopItem["host"];
  //console.log(scopes);
  const settingsObjects = await settingsObjectsClient.getSettingsObjects({
      schemaIds: "builtin:host.monitoring",
      scopes,
      fields: "objectId,value,summary,searchSummary,created,modifid,createdBy,modifiedBy,author,updateToken,scope,modificationInfo,schemaId,schemaVersion,externalId"
    });
  //console.log(settingsObjects);
  if (settingsObjects.items.length &amp;gt; 0){
    const settingsObject = (settingsObjects.items[0]);
    const settingsObjectResponse = await settingsObjectsClient.putSettingsObjectByObjectId({
        objectId: settingsObject.objectId,
        body: {
          updateToken: settingsObject.updateToken,
          value: {
            "enabled": false
          }
        }
      });
    return { settingsObjectResponse };
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sinisa_zubic_3-1718815258779.png" style="width: 200px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20642i95B494A20B56B0EE/image-size/small?v=v2&amp;amp;px=200" role="button" title="sinisa_zubic_3-1718815258779.png" alt="sinisa_zubic_3-1718815258779.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 16:41:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/248687#M1636</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2024-06-19T16:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/248704#M1640</link>
      <description>&lt;P&gt;Thanks Sini,&amp;nbsp;&lt;SPAN&gt;javascript task works well.&lt;BR /&gt;&lt;BR /&gt;I was unable to use the http request with loop task as it was unable to read allobjects.json.item in loop. I am not sure if I did something wrong but the first task to get all objects task ran through fine.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 03:44:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/248704#M1640</guid>
      <dc:creator>Smalhotra89</dc:creator>
      <dc:date>2024-06-20T03:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254634#M1772</link>
      <description>&lt;P&gt;How do I iterate through all values from a fetch query using javascript?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vs185250_0-1725068819983.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22136iF47C178D1EB938D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vs185250_0-1725068819983.png" alt="vs185250_0-1725068819983.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vs185250_1-1725068883642.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22137iDC1568510C838775/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vs185250_1-1725068883642.png" alt="vs185250_1-1725068883642.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vs185250_2-1725068924616.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22138iEF709B6831FF9314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vs185250_2-1725068924616.png" alt="vs185250_2-1725068924616.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 01:48:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254634#M1772</guid>
      <dc:creator>vs185250</dc:creator>
      <dc:date>2024-08-31T01:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254636#M1773</link>
      <description>&lt;P&gt;here is the loop item&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vs185250_3-1725068975651.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22139iA57E68C68E89D930/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vs185250_3-1725068975651.png" alt="vs185250_3-1725068975651.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 01:49:44 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254636#M1773</guid>
      <dc:creator>vs185250</dc:creator>
      <dc:date>2024-08-31T01:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254638#M1774</link>
      <description>&lt;P&gt;nvm. figured it out&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vs185250_4-1725069193027.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22140iA349AD4420DE80FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vs185250_4-1725069193027.png" alt="vs185250_4-1725069193027.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 01:53:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254638#M1774</guid>
      <dc:creator>vs185250</dc:creator>
      <dc:date>2024-08-31T01:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254640#M1775</link>
      <description>&lt;P&gt;this worked for me and disabled monitoring on all hosts&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vs185250_5-1725070526855.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22141i0CE21DFC490033CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vs185250_5-1725070526855.png" alt="vs185250_5-1725070526855.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 02:15:59 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254640#M1775</guid>
      <dc:creator>vs185250</dc:creator>
      <dc:date>2024-08-31T02:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254641#M1776</link>
      <description>&lt;P&gt;Thank You, I made it work for all tagged hosts.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 02:20:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/254641#M1776</guid>
      <dc:creator>Smalhotra89</dc:creator>
      <dc:date>2024-08-31T02:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/270132#M2047</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/47021"&gt;@vs185250&lt;/a&gt;&amp;nbsp;,&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/77190"&gt;@Smalhotra89&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I hope you guys are doing well.&lt;/P&gt;&lt;P&gt;I have replicated the above use case in my environment and it is not getting executed and requesting your help here.&lt;/P&gt;&lt;P&gt;Do I have to pass any bearer token ?&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2025 07:00:03 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/270132#M2047</guid>
      <dc:creator>DineshP</dc:creator>
      <dc:date>2025-02-15T07:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/270184#M2048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/86799"&gt;@DineshP&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;In this case you have to use API token instead Bearer Token.&lt;/P&gt;&lt;P&gt;The APIs using in this workflow requeries API token.&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Elena.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 06:51:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/270184#M2048</guid>
      <dc:creator>erh_inetum</dc:creator>
      <dc:date>2025-02-17T06:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/270186#M2049</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/40722"&gt;@erh_inetum&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the assistance, It would be great if you can help with some steps to proceed further to achieve the same.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;DP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 06:58:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/270186#M2049</guid>
      <dc:creator>DineshP</dc:creator>
      <dc:date>2025-02-17T06:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a loop task to enable/disable host monitoring using workflows</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/270189#M2050</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You have to use this header:&lt;/P&gt;&lt;P&gt;headers: {&lt;BR /&gt;'Accept': 'application/json; charset=utf-8',&lt;BR /&gt;'Authorization': 'Api-Token dt0c01.XXXXXXXXXXXXXXXXX'&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;like in this screenshot&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erh_inetum_0-1739777398740.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26444i98149AA214BD7BE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erh_inetum_0-1739777398740.png" alt="erh_inetum_0-1739777398740.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sent by &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;&amp;nbsp;in the first reply of this post.&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Elena.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 07:30:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/270189#M2050</guid>
      <dc:creator>erh_inetum</dc:creator>
      <dc:date>2025-02-17T07:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add loop task to enable or disable host monitoring</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/294042#M2490</link>
      <description>&lt;P&gt;I have the same ask, can someone upload a workflow that uses javascript or api method to enable or disable hosts that belong to a certain host group?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 19:20:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/294042#M2490</guid>
      <dc:creator>CTull</dc:creator>
      <dc:date>2026-02-02T19:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add loop task to enable or disable host monitoring</title>
      <link>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/294043#M2491</link>
      <description>&lt;P&gt;Batch file for now:&lt;/P&gt;&lt;P&gt;@echo off&lt;BR /&gt;setlocal ENABLEDELAYEDEXPANSION&lt;/P&gt;&lt;P&gt;REM ==== Config ====&lt;BR /&gt;set DT_ENV_URL=&lt;A href="https://{environmentid}.live.dynatrace.com" target="_blank"&gt;https://{environmentid}.live.dynatrace.com&lt;/A&gt;&lt;BR /&gt;set DT_API_TOKEN=dt0c01.YOURLONGA$$TOKENNAME&lt;BR /&gt;if "%DT_API_TOKEN%"=="" (&lt;BR /&gt;echo ERROR: Please set DT_API_TOKEN environment variable.&lt;BR /&gt;exit /b 1&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;set ENDPOINT=%DT_ENV_URL%/api/v2/settings/objects&lt;/P&gt;&lt;P&gt;REM ==== Host list ====&lt;/P&gt;&lt;P&gt;REM ++++Exported List from Dynatrace Infrastructure and Operations App++++&lt;/P&gt;&lt;P&gt;set HOSTS= ^&lt;BR /&gt;HOST-xxxaaa ^&lt;BR /&gt;HOST-xxxfffff ^&lt;BR /&gt;HOST-xxxddd ^&lt;BR /&gt;HOST-xxx&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;for %%H in (%HOSTS%) do (&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; echo Posting for %%H ...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; set PAYLOAD=[{""schemaId"":""builtin:host.monitoring"",""schemaVersion"":""1.4"",""scope"":""%%H"",""value"":{""enabled"":false}}]&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; curl -s -X POST ^&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -H "Accept: application/json; charset=utf-8" ^&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -H "Content-Type: application/json; charset=utf-8" ^&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -H "Authorization: Api-Token %DT_API_TOKEN%" ^&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -d "!PAYLOAD!" ^&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "%ENDPOINT%"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; echo.&lt;/DIV&gt;&lt;DIV&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;endlocal&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 19:58:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Add-loop-task-to-enable-or-disable-host-monitoring/m-p/294043#M2491</guid>
      <dc:creator>CTull</dc:creator>
      <dc:date>2026-02-02T19:58:42Z</dc:date>
    </item>
  </channel>
</rss>

