<?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: How to script start/stop service, with web-tier authentication? in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-script-start-stop-service-with-web-tier/m-p/1101451#M31166</link>
    <description>&lt;P&gt;Thank you, Jonathan!&amp;nbsp; I appreciate your reply.&lt;/P&gt;&lt;P&gt;I don't really know anything about requests and scripting internet-related things (someone else wrote the scripts that I have to work with), so I don't yet understand what those sources are talking about, but I will keep doing research and learning.&amp;nbsp; You have given me a helpful starting place, with those links and your reply.&amp;nbsp; Thank you!!&lt;/P&gt;</description>
    <pubDate>Thu, 23 Sep 2021 20:23:12 GMT</pubDate>
    <dc:creator>AllenDailey1</dc:creator>
    <dc:date>2021-09-23T20:23:12Z</dc:date>
    <item>
      <title>How to script start/stop service, with web-tier authentication?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-script-start-stop-service-with-web-tier/m-p/1098191#M31109</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have done lots of searching about this but have not found anything in Esri documentation or here in the Community, so I thought I'd see if anyone can help.&lt;/P&gt;&lt;P&gt;My organization is in the midst of a server migration.&amp;nbsp; In our old ArcGIS Server environment, we had token authentication, but in the new one, we have web-tier authentication.&amp;nbsp; &lt;STRONG&gt;I am trying to migrate a Python script that rebuilt an address locator in the old environment; the script includes stopping and then starting services, which is necessary for rebuilding the address locator.&amp;nbsp;&lt;/STRONG&gt; I have 2 main problems:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;The first problem is that I have no idea how to write Python for web-tier authentication,&lt;/STRONG&gt; instead of tokens. I have researched this but haven't found anything.&amp;nbsp; &lt;STRONG&gt;Any suggestions?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;The second problem is that it sounds like it's not possible to stop/start services via a script anymore, at least not as simply as in the past (see:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/td-p/646090" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-enterprise-questions/start-stop-secure-services-in-10-6-1/td-p/646090&lt;/A&gt;&amp;nbsp;).&amp;nbsp;&lt;UL&gt;&lt;LI&gt;I saw that it is possible to do it with the ArcGIS API for Python, but that it requires that the server be federated (&lt;A href="https://support.esri.com/en/technical-article/000019994" target="_blank"&gt;https://support.esri.com/en/technical-article/000019994&lt;/A&gt;&amp;nbsp;).&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;The involved servers are not federated, unfortunately, but we have other servers that are federated.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Does anyone know how to stop/start services in a script, services that are not on a federated server?&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;Allen&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:48:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-script-start-stop-service-with-web-tier/m-p/1098191#M31109</guid>
      <dc:creator>AllenDailey1</dc:creator>
      <dc:date>2021-09-14T19:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to script start/stop service, with web-tier authentication?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-script-start-stop-service-with-web-tier/m-p/1098723#M31112</link>
      <description>&lt;P&gt;You can use the requests_ntlm library using the&amp;nbsp;HttpNtlmAuth or HttpNegotiateAuth functions. HttpNtlmAuth requires you to pass in a username and password but HttpNegotiateAuth can simulate a single sign on experience.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://pypi.org/project/requests_ntlm/0.2.0/" target="_blank"&gt;https://pypi.org/project/requests_ntlm/0.2.0/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://github.com/brandond/requests-negotiate-sspi" target="_blank"&gt;https://github.com/brandond/requests-negotiate-sspi&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;For services that are not on a federated Server using IWA, once you know what APIs are responsible for stopping/starting services, you can use the requests library; the samples on their help page are pretty useful. For example, use either function above, then use the auth object in the requests.post function:&lt;BR /&gt;&lt;BR /&gt;response = requests.post(url,data=params,auth=auth).text&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 22:40:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-script-start-stop-service-with-web-tier/m-p/1098723#M31112</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2021-09-15T22:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to script start/stop service, with web-tier authentication?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-script-start-stop-service-with-web-tier/m-p/1101451#M31166</link>
      <description>&lt;P&gt;Thank you, Jonathan!&amp;nbsp; I appreciate your reply.&lt;/P&gt;&lt;P&gt;I don't really know anything about requests and scripting internet-related things (someone else wrote the scripts that I have to work with), so I don't yet understand what those sources are talking about, but I will keep doing research and learning.&amp;nbsp; You have given me a helpful starting place, with those links and your reply.&amp;nbsp; Thank you!!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 20:23:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-script-start-stop-service-with-web-tier/m-p/1101451#M31166</guid>
      <dc:creator>AllenDailey1</dc:creator>
      <dc:date>2021-09-23T20:23:12Z</dc:date>
    </item>
  </channel>
</rss>

