<?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 Re: Persistent COM Surrogates running Python scripts calling Pro and Location Sharing via Task Scheduler in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1646850#M74671</link>
    <description>&lt;P&gt;Have you tried using ArcGis Pro's built in scheduler? do you have to reference the aprx?&lt;/P&gt;&lt;P&gt;I think ArcGIS Pyton API can&amp;nbsp; query &amp;amp; append without touching an APRX.&lt;/P&gt;&lt;P&gt;&lt;A target="_new" rel="noopener"&gt;ArcGIS Python API&lt;/A&gt;&lt;/P&gt;&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;</description>
    <pubDate>Fri, 29 Aug 2025 15:28:43 GMT</pubDate>
    <dc:creator>TonyAlmeida</dc:creator>
    <dc:date>2025-08-29T15:28:43Z</dc:date>
    <item>
      <title>Persistent COM Surrogates running Python scripts calling Pro and Location Sharing via Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1646306#M74670</link>
      <description>&lt;P&gt;When I use Task Scheduler to run a Python script that references an APRX containing our Tracks layer from Location Sharing (Enterprise), and I am NOT logged in, a persistent COM Surrogate is created. I have a script I want to run every 5 minutes but cannot because these COM Surrogates build up and create problems.&lt;/P&gt;&lt;P&gt;I am looking for suggestions to avoid this issue!&lt;/P&gt;&lt;P&gt;Here are our specs:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Enterprise 11.3 with up-to-date patching&lt;/LI&gt;&lt;LI&gt;ArcGIS Pro 3.3.6 or ArcGIS Pro 3.5.2 (same result)&lt;/LI&gt;&lt;LI&gt;ArcGIS Pro Named User license, online or offline, or ArcGIS Pro Advanced Single Use license&lt;/LI&gt;&lt;LI&gt;Task Scheduler running with highest privileges, whether or not user is logged in&lt;/LI&gt;&lt;LI&gt;Task Scheduler referencing C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe, pythonw.exe, or C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\propy.bat all have the same result&lt;/LI&gt;&lt;LI&gt;User account running Task Scheduler scripts is admin on the machine&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Multi-user, Windows 10 Azure Virtual Desktop&amp;nbsp;running the scripts via Task Scheduler&lt;/LI&gt;&lt;LI&gt;COM Surrogate details:&amp;nbsp;C:\Windows\System32\dllhost.exe&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The script in question creates polylines from Tracks collected that day and appends them to a referenced feature service. These allow users to see each other's tracks in the field, updated every 5 minutes, which is useful for ensuring complete coverage for our monitoring work. (Tracklines are automatically created from Tracks in AGOL, but sadly this functionality does not exist for Enterprise.) I can just stay logged into the AVD machine at all times to prevent COM Surrogate issues, but I have been told this is not a sustainable solution.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 23:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1646306#M74670</guid>
      <dc:creator>IngridHogle</dc:creator>
      <dc:date>2025-08-27T23:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Persistent COM Surrogates running Python scripts calling Pro and Location Sharing via Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1646850#M74671</link>
      <description>&lt;P&gt;Have you tried using ArcGis Pro's built in scheduler? do you have to reference the aprx?&lt;/P&gt;&lt;P&gt;I think ArcGIS Pyton API can&amp;nbsp; query &amp;amp; append without touching an APRX.&lt;/P&gt;&lt;P&gt;&lt;A target="_new" rel="noopener"&gt;ArcGIS Python API&lt;/A&gt;&lt;/P&gt;&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;</description>
      <pubDate>Fri, 29 Aug 2025 15:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1646850#M74671</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2025-08-29T15:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Persistent COM Surrogates running Python scripts calling Pro and Location Sharing via Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1647038#M74672</link>
      <description>&lt;P&gt;Is this happening with a Python script? If so have you looked into killing the interpreter after it runs? Could be that you haven't properly cleaned up the environment and since there isn't a user process to kill those locks.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Aug 2025 06:18:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1647038#M74672</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2025-08-30T06:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Persistent COM Surrogates running Python scripts calling Pro and Location Sharing via Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1649893#M74689</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3265"&gt;@TonyAlmeida&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/607017"&gt;@HaydenWelch&lt;/a&gt;&amp;nbsp;, for your suggestions. Our IT folks migrated us to a new, Windows 11 Azure virtual desktop (AVD) machine, we moved the automated scripts to this machine, and the problem went away! Phew!&lt;/P&gt;&lt;P&gt;I've been advised that the problem was likely something unique to the computers on which we were running these (Windows 10 AVD and an AVD Windows 2022 Server machine). I've been told that other customers are able to run Task Scheduler python scripts calling arcpy without this issue...and we did so for over a year before this started happening. It's a mystery, but all's well that ends well.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 20:40:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/persistent-com-surrogates-running-python-scripts/m-p/1649893#M74689</guid>
      <dc:creator>IngridHogle</dc:creator>
      <dc:date>2025-09-11T20:40:07Z</dc:date>
    </item>
  </channel>
</rss>

