<?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: script to stop ArcGIS Server service in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135235#M10600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It turns out it was definitely a permissions thing.&amp;nbsp; My user account wasn't able to stop the service.&amp;nbsp; Once adjusted it works as intended.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Feb 2013 14:03:59 GMT</pubDate>
    <dc:creator>EricGardecki</dc:creator>
    <dc:date>2013-02-12T14:03:59Z</dc:date>
    <item>
      <title>script to stop ArcGIS Server service</title>
      <link>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135230#M10595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've used the following script to start/stop the AGS windows service, standalone and in models, so I can do some data management with very little downtime.&amp;nbsp; This script worked find in 10.0 but doesn't work in 10.1 now.&amp;nbsp; The name of the windows service changed and is reflected in the script but it does not start/stop the service as expected.&amp;nbsp; I can't seem to find out what changed in 10.1 that made this not work, nor can I find any alternative that makes any sense to me.&amp;nbsp; I need it to be a script without any prompts.&amp;nbsp; I've seen posts about stopping individual services but I don't see the need to do that when I can stop it all through the windows service instead...and much faster....plus all those scripts prompted for service name.&amp;nbsp;&amp;nbsp; Anyone know what is wrong with this code now?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import os
import arcpy
os.system('sc \\\\MachineName stop "ArcGIS Server"')&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 18:26:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135230#M10595</guid>
      <dc:creator>EricGardecki</dc:creator>
      <dc:date>2013-02-11T18:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: script to stop ArcGIS Server service</title>
      <link>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135231#M10596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is the error you are receiving?&amp;nbsp; Also, are you executing the script on the same server that ArcGIS for Server is running?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 10:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135231#M10596</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-02-12T10:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: script to stop ArcGIS Server service</title>
      <link>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135232#M10597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am getting no errors.&amp;nbsp; A cmd window opens and closes again so fast I can't see if it says anything.&amp;nbsp; I kept getting schema lock messages in my model and then I checked the services on the server and the ArcGIS Server service was still running and continued to after trying the script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm running it on another machine.&amp;nbsp; The machine with ArcGIS desktop on it, where I run my models.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 11:01:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135232#M10597</guid>
      <dc:creator>EricGardecki</dc:creator>
      <dc:date>2013-02-12T11:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: script to stop ArcGIS Server service</title>
      <link>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135233#M10598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Create a new txt file and place the following command within the file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sc \\&amp;lt;server&amp;gt; stop "ArcGIS Server"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Save the txt file and rename it to .bat.&amp;nbsp; Then, try executing the os.system command in python to run the batch file.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
os.system(r"C:\temp\test.bat")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:33:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135233#M10598</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T07:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: script to stop ArcGIS Server service</title>
      <link>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135234#M10599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;same result.&amp;nbsp;&amp;nbsp; Any other thoughts?&amp;nbsp;&amp;nbsp; Is it possibly a permissions issue with the service?&amp;nbsp; That's the only thing that jumps out at me as the service is set to logon as the AGS admin account instead of local system.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 11:52:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135234#M10599</guid>
      <dc:creator>EricGardecki</dc:creator>
      <dc:date>2013-02-12T11:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: script to stop ArcGIS Server service</title>
      <link>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135235#M10600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It turns out it was definitely a permissions thing.&amp;nbsp; My user account wasn't able to stop the service.&amp;nbsp; Once adjusted it works as intended.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 14:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-stop-arcgis-server-service/m-p/135235#M10600</guid>
      <dc:creator>EricGardecki</dc:creator>
      <dc:date>2013-02-12T14:03:59Z</dc:date>
    </item>
  </channel>
</rss>

