<?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: Python Script to Disconnect all users from a database in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109940#M8506</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using a SDE user Connection to establish this? It needs to be either the SDE user or possibly the SA user for it to work properly, preferably the SDE user&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2014 18:32:22 GMT</pubDate>
    <dc:creator>BenDrury</dc:creator>
    <dc:date>2014-10-21T18:32:22Z</dc:date>
    <item>
      <title>Python Script to Disconnect all users from a database</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109937#M8503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am &lt;/SPAN&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;SPAN&gt; very Python savvy...&amp;nbsp; trying to develop a script to disconnect all users from a 10.2.2 SDE database.&amp;nbsp; Can anyone tell me what I'm doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcinfo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Variables:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sde_TestServer = "\\\\computer\\c$\\Users\\user\\AppData\\Roaming\\ESRI\\Desktop10.2\\ArcCatalog\\sde@TestServer.sde"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Disconnect Users&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.DisconnectUser ("sde_TestServer", "ALL")&lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;THANKS!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 17:21:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109937#M8503</guid>
      <dc:creator>BenDrury</dc:creator>
      <dc:date>2014-05-09T17:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Disconnect all users from a database</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109938#M8504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are python savvy Katherine! You're only missing one thing: take the quotes away from &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; text-decoration: underline;"&gt;sde_TestServer&lt;/SPAN&gt;&lt;SPAN&gt;. Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcinfo
import arcpy

# Variables:
sde_TestServer = "\\\\computer\\c$\\Users\\user\\AppData\\Roaming\\ESRI\\Desktop10.2\\ArcCatalog\\sde@TestServer.sde"

#Disconnect Users
arcpy.DisconnectUser (sde_TestServer, "ALL")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason: if python sees &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; text-decoration: underline;"&gt;"sde_TestServer"&lt;/SPAN&gt;&lt;SPAN&gt; it reads it as the string &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;"sde_TestServer"&lt;/SPAN&gt;&lt;SPAN&gt;. If python sees &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; text-decoration: underline;"&gt;sde_TestServer&lt;/SPAN&gt;&lt;SPAN&gt; it looks for a variable that was previously set using that name.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:36:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109938#M8504</guid>
      <dc:creator>JoshuaChisholm</dc:creator>
      <dc:date>2021-12-11T06:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Disconnect all users from a database</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109939#M8505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Josh&lt;/P&gt;&lt;P&gt;Id like to have this handy tool as well. But I was running into an error, says Connection information provided was for a non-administrative user. But the user "msdgc" can disconnect user from ArcCatalog.&amp;nbsp; would you please help, thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcinfo&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;# Variables:&amp;nbsp; &lt;BR /&gt;sde_Server = "c:\\Users\\user\\AppData\\Roaming\\ESRI\\Desktop10.1\\ArcCatalog\\msdgc@msdtest.sde"&amp;nbsp; &lt;/P&gt;&lt;P&gt;arcpy.DisconnectUser(sde_Server, "ALL")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Program Files (x86)\SystemScheduler\disconnectuser.py", line 8, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DisconnectUser(sde_Server, "ALL")&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\__init__.py", line 1040, in DisconnectUser&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return gp.disconnectUser(sde_workspace, users)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 498, in &amp;lt;lambda&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args, True))&lt;/P&gt;&lt;P&gt;RuntimeError: Connection information provided was for a non-administrative user&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 14:52:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109939#M8505</guid>
      <dc:creator>AimeiChen</dc:creator>
      <dc:date>2014-10-21T14:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Disconnect all users from a database</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109940#M8506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using a SDE user Connection to establish this? It needs to be either the SDE user or possibly the SA user for it to work properly, preferably the SDE user&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 18:32:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109940#M8506</guid>
      <dc:creator>BenDrury</dc:creator>
      <dc:date>2014-10-21T18:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Disconnect all users from a database</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109941#M8507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I switched to SDE user but still got same error message. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 16:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109941#M8507</guid>
      <dc:creator>AimeiChen</dc:creator>
      <dc:date>2014-10-24T16:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Disconnect all users from a database</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109942#M8508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does the sde user have "processadmin" fixed server role?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 19:02:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-disconnect-all-users-from-a/m-p/109942#M8508</guid>
      <dc:creator>AsrujitSengupta</dc:creator>
      <dc:date>2014-10-24T19:02:17Z</dc:date>
    </item>
  </channel>
</rss>

