<?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 Disconnect All Users from a Geodatabase in pyhton in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/disconnect-all-users-from-a-geodatabase-in-pyhton/m-p/481597#M27403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to throw all users out of the disconnect except for a user, I do not want to throw the user who is connected as a dbo&lt;/P&gt;&lt;P&gt;So, I want to throw out the users I selected in the picture, and I do not want to throw away those that are not selected.&lt;BR /&gt;How can i use it as python?&lt;/P&gt;&lt;P&gt;(What I actually want to do is,&lt;BR /&gt;To take out the users with the pyhton and to unregister- register as versioned later.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a pyhton like this, but can not connect again because I throw all the users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;# Dont Accept Geo database connections to the CBS database!&lt;BR /&gt;arcpy.AcceptConnections('Database Connections\\172.16.200.86_CBS_sa.sde', False)&lt;BR /&gt;# Disconnect all users in the GIS Databases!&lt;BR /&gt;arcpy.DisconnectUser('Database Connections\\172.16.200.86_CBS_sa.sde', "ALL")&lt;BR /&gt;# For CBS_PE Dataset Unregister Connections&lt;BR /&gt;CBS_KULLANICI_PE_Hat = "Database Connections\\172.16.200.86_CBS_kullanici.sde\\CBS.KULLANICI.PE_Hat"&lt;BR /&gt;CBS_KULLANICI_PE_Hat__2_ = CBS_KULLANICI_PE_Hat&lt;BR /&gt;# For CBS_PE dataset Unregister As Versioned APPLY!&lt;BR /&gt;arcpy.UnregisterAsVersioned_management(CBS_KULLANICI_PE_Hat, "KEEP_EDIT", "COMPRESS_DEFAULT")&lt;BR /&gt;# For CBS_PE Dataset register Connections&lt;BR /&gt;CBS_KULLANICI_PE_Hat = "Database Connections\\172.16.200.86_CBS_kullanici.sde\\CBS.KULLANICI.PE_Hat"&lt;BR /&gt;Output_Dataset = CBS_KULLANICI_PE_Hat&lt;BR /&gt;# For CBS_PE dataset register As Versioned APPLY!&lt;BR /&gt;arcpy.RegisterAsVersioned_management(CBS_KULLANICI_PE_Hat, "NO_EDITS_TO_BASE")&lt;BR /&gt;# Accept Geo database connections to the CBS database!&lt;BR /&gt;arcpy.AcceptConnections('Database Connections\\172.16.200.86_CBS_sa.sde', True)&lt;BR /&gt;# Run the Compress tool for CBS Databases.&lt;BR /&gt;arcpy.Compress_management('Database Connections\\172.16.200.86_CBS_sa.sde')&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do that?&lt;BR /&gt;Thank you all##&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Apr 2017 06:07:40 GMT</pubDate>
    <dc:creator>GIS_Solutions</dc:creator>
    <dc:date>2017-04-20T06:07:40Z</dc:date>
    <item>
      <title>Disconnect All Users from a Geodatabase in pyhton</title>
      <link>https://community.esri.com/t5/data-management-questions/disconnect-all-users-from-a-geodatabase-in-pyhton/m-p/481597#M27403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to throw all users out of the disconnect except for a user, I do not want to throw the user who is connected as a dbo&lt;/P&gt;&lt;P&gt;So, I want to throw out the users I selected in the picture, and I do not want to throw away those that are not selected.&lt;BR /&gt;How can i use it as python?&lt;/P&gt;&lt;P&gt;(What I actually want to do is,&lt;BR /&gt;To take out the users with the pyhton and to unregister- register as versioned later.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a pyhton like this, but can not connect again because I throw all the users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;# Dont Accept Geo database connections to the CBS database!&lt;BR /&gt;arcpy.AcceptConnections('Database Connections\\172.16.200.86_CBS_sa.sde', False)&lt;BR /&gt;# Disconnect all users in the GIS Databases!&lt;BR /&gt;arcpy.DisconnectUser('Database Connections\\172.16.200.86_CBS_sa.sde', "ALL")&lt;BR /&gt;# For CBS_PE Dataset Unregister Connections&lt;BR /&gt;CBS_KULLANICI_PE_Hat = "Database Connections\\172.16.200.86_CBS_kullanici.sde\\CBS.KULLANICI.PE_Hat"&lt;BR /&gt;CBS_KULLANICI_PE_Hat__2_ = CBS_KULLANICI_PE_Hat&lt;BR /&gt;# For CBS_PE dataset Unregister As Versioned APPLY!&lt;BR /&gt;arcpy.UnregisterAsVersioned_management(CBS_KULLANICI_PE_Hat, "KEEP_EDIT", "COMPRESS_DEFAULT")&lt;BR /&gt;# For CBS_PE Dataset register Connections&lt;BR /&gt;CBS_KULLANICI_PE_Hat = "Database Connections\\172.16.200.86_CBS_kullanici.sde\\CBS.KULLANICI.PE_Hat"&lt;BR /&gt;Output_Dataset = CBS_KULLANICI_PE_Hat&lt;BR /&gt;# For CBS_PE dataset register As Versioned APPLY!&lt;BR /&gt;arcpy.RegisterAsVersioned_management(CBS_KULLANICI_PE_Hat, "NO_EDITS_TO_BASE")&lt;BR /&gt;# Accept Geo database connections to the CBS database!&lt;BR /&gt;arcpy.AcceptConnections('Database Connections\\172.16.200.86_CBS_sa.sde', True)&lt;BR /&gt;# Run the Compress tool for CBS Databases.&lt;BR /&gt;arcpy.Compress_management('Database Connections\\172.16.200.86_CBS_sa.sde')&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do that?&lt;BR /&gt;Thank you all##&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 06:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/disconnect-all-users-from-a-geodatabase-in-pyhton/m-p/481597#M27403</guid>
      <dc:creator>GIS_Solutions</dc:creator>
      <dc:date>2017-04-20T06:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect All Users from a Geodatabase in pyhton</title>
      <link>https://community.esri.com/t5/data-management-questions/disconnect-all-users-from-a-geodatabase-in-pyhton/m-p/481598#M27404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bekir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Accept connection call in ArcPy allows an administrator to enable or disable the ability of nonadministrative users to make connections to an enterprise geodatabase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you run this part of your script, you connect as the DBO (SA):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# Dont Accept Geo database connections to the CBS database!&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AcceptConnections&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Database Connections\\172.16.200.86_CBS_sa.sde'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Disconnect all users in the GIS Databases!&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DisconnectUser&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Database Connections\\172.16.200.86_CBS_sa.sde'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are connected as DBO, that particular connection is the only one that can access the database. &amp;nbsp; In your case&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;KULLANICI wont be able to connect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;~Alex&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:15:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/disconnect-all-users-from-a-geodatabase-in-pyhton/m-p/481598#M27404</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2021-12-11T21:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect All Users from a Geodatabase in pyhton</title>
      <link>https://community.esri.com/t5/data-management-questions/disconnect-all-users-from-a-geodatabase-in-pyhton/m-p/481599#M27405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;After running the arcpy.DisconnectUser I noticed that users in ArcCatalog and ArcMap have to disconnect and reconnect.&amp;nbsp; How does this affect "map services?"&amp;nbsp; Do they reconnect automatically or do that have to be restarted?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2020 23:51:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/disconnect-all-users-from-a-geodatabase-in-pyhton/m-p/481599#M27405</guid>
      <dc:creator>RandyKreuziger1</dc:creator>
      <dc:date>2020-06-02T23:51:24Z</dc:date>
    </item>
  </channel>
</rss>

