<?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: ArcGIS Pro Scheduling a Python scripted Portal item update in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1221329#M60989</link>
    <description>&lt;P&gt;Have you tried running it manually with IDLE "outside" of Pro?&lt;/P&gt;&lt;P&gt;This might give you some error/messages that could make it easier to debug.&lt;/P&gt;&lt;P&gt;If I had to guess, I'd think it is something to do with setting the GIS to 'Pro', but is not running within pro as the task scheduler will run as stand alone.&lt;/P&gt;&lt;P&gt;suspect it is lookinng for something more like:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;gis = GIS("https://portalname.domain.com", "sharinguser", "password")&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#connecting-through-arcgis-pro" target="_self"&gt;More here.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2022 22:51:13 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2022-10-12T22:51:13Z</dc:date>
    <item>
      <title>ArcGIS Pro Scheduling a Python scripted Portal item update</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1221309#M60985</link>
      <description>&lt;P&gt;I am not very familiar with Python but am trying to write a script in ArcGIS Pro that will update the offline areas that I have created for a web map that is hosted on our organisation's Enterprise Portal. I have gotten the script to execute perfectly fine when I manually run it in Pro but I want to schedule it to run using Windows Task Scheduler so that these updates can occur outside of work hours.&lt;/P&gt;&lt;P&gt;I set up a schedule however when I checked back later the updates hadn't occurred. There was nothing in the 'History' pane of ArcGIS Pro that suggested the task had even attempted to run (it still said 'Scheduled'). I first thought that this was an issue with Pro being closed and the Portal not being able to be authenticated and so I scheduled the task to run again and left Pro open but the same result happened. Now I am thinking that perhaps it is not an authentication issue but something else altogether.&lt;/P&gt;&lt;P&gt;This is a cut-down version of the script I am trying to run;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; arcgis.gis &lt;SPAN class=""&gt;import&lt;/SPAN&gt; GIS
&lt;SPAN class=""&gt;from&lt;/SPAN&gt; arcgis.mapping &lt;SPAN class=""&gt;import&lt;/SPAN&gt; WebMap
&lt;SPAN class=""&gt;import&lt;/SPAN&gt; arcpy

gis = GIS(&lt;SPAN class=""&gt;'Pro'&lt;/SPAN&gt;)


GIS_admin = &lt;SPAN class=""&gt;'aa7f0378d0bd4c31a1bd18b2dbac1b11'&lt;/SPAN&gt;
map_item = gis.content.get(&lt;SPAN class=""&gt;'686be07874f946df91d7d72b2f87e347'&lt;/SPAN&gt;)

map_item.unshare(groups=[GIS_admin])
WebMap(map_item).offline_areas.update()

map_item.share(groups=GIS_admin, allow_members_to_edit=&lt;SPAN class=""&gt;True&lt;/SPAN&gt;)
        &lt;/PRE&gt;&lt;P&gt;I have tried playing around with the settings in Windows Task Scheduler itself to 'Run whether user is logged in or not' without success. If someone has any light that they can shed that would be greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 21:43:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1221309#M60985</guid>
      <dc:creator>SamuelMcAuley</dc:creator>
      <dc:date>2022-10-12T21:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Scheduling a Python scripted Portal item update</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1221329#M60989</link>
      <description>&lt;P&gt;Have you tried running it manually with IDLE "outside" of Pro?&lt;/P&gt;&lt;P&gt;This might give you some error/messages that could make it easier to debug.&lt;/P&gt;&lt;P&gt;If I had to guess, I'd think it is something to do with setting the GIS to 'Pro', but is not running within pro as the task scheduler will run as stand alone.&lt;/P&gt;&lt;P&gt;suspect it is lookinng for something more like:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;gis = GIS("https://portalname.domain.com", "sharinguser", "password")&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#connecting-through-arcgis-pro" target="_self"&gt;More here.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 22:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1221329#M60989</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-10-12T22:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Scheduling a Python scripted Portal item update</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1221900#M61067</link>
      <description>&lt;P&gt;I have tried running it in a Jupyter Notebook whilst Pro was closed and it worked totally fine. That was using both these parameters:&lt;/P&gt;&lt;P&gt;gis = GIS("home")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;gis = ("Pro")&lt;/P&gt;&lt;P&gt;So not sure if that addresses your point?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 04:58:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1221900#M61067</guid>
      <dc:creator>SamuelMcAuley</dc:creator>
      <dc:date>2022-10-14T04:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Scheduling a Python scripted Portal item update</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1223157#M61257</link>
      <description>&lt;P&gt;Update: I have discovered the problem. It was nothing to do with the code or the authentication but instead it was to do with the Toolbox in which the script was saved. The toolbox in which it was saved was built in ArcMap and we have since built new toolboxes in ArcGIS Pro. I migrated the script to one of these newer toolboxes and scheduled it and it worked as expected. Perhaps there are some compatibility issues with Toolboxes between ArcMap and Pro. Anyhow, thanks for the input &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 04:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-scheduling-a-python-scripted-portal/m-p/1223157#M61257</guid>
      <dc:creator>SamuelMcAuley</dc:creator>
      <dc:date>2022-10-19T04:35:51Z</dc:date>
    </item>
  </channel>
</rss>

