<?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 Return list of users locking/using an object in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/return-list-of-users-locking-using-an-object/m-p/1287043#M35865</link>
    <description>&lt;P&gt;Is there a way to return the list of users locking a distinct geodatabase object (feature class, object table, domain) using python/arcpy ?&amp;nbsp; if there is no way now, can this be added as a new feature..?&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2023 22:37:39 GMT</pubDate>
    <dc:creator>JoseG_Esri</dc:creator>
    <dc:date>2023-05-08T22:37:39Z</dc:date>
    <item>
      <title>Return list of users locking/using an object</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/return-list-of-users-locking-using-an-object/m-p/1287043#M35865</link>
      <description>&lt;P&gt;Is there a way to return the list of users locking a distinct geodatabase object (feature class, object table, domain) using python/arcpy ?&amp;nbsp; if there is no way now, can this be added as a new feature..?&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 22:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/return-list-of-users-locking-using-an-object/m-p/1287043#M35865</guid>
      <dc:creator>JoseG_Esri</dc:creator>
      <dc:date>2023-05-08T22:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Return list of users locking/using an object</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/return-list-of-users-locking-using-an-object/m-p/1287197#M35876</link>
      <description>&lt;P&gt;I once saw a blog post example for returning a list of connected users in order to send them an email before database reconciliation occurred.&amp;nbsp; Seems like that would be a good starting point.&lt;/P&gt;&lt;P&gt;That particular example in my code looks like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sdeConnection = r"Insert/your/path/here"

#list users connected to database
userList = arcpy.ListUsers(sdeConnection)

# get a list of user names from the list of named tuples returned from ListUsers
userNames = [u.Name for u in userList]

mylist = list(dict.fromkeys(userNames))
#I removed a few extra characters to clean up the user list because I needed to create emails, so you'll have to work on this part to customize it to your needs
mylist.remove('DBO') 
mylist = [(name[10:-1]) for name in mylist ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;Here is the&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listusers.htm" target="_self"&gt; link&lt;/A&gt; to the syntax doc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a &lt;A href="https://community.esri.com/t5/python-questions/email-list-of-connected-users-needs-character/td-p/368629" target="_self"&gt;GeoNet post&lt;/A&gt; where someone is working through the example I mentioned, &amp;amp; they link back to the original post.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 12:30:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/return-list-of-users-locking-using-an-object/m-p/1287197#M35876</guid>
      <dc:creator>Kara_Shindle</dc:creator>
      <dc:date>2023-05-09T12:30:59Z</dc:date>
    </item>
  </channel>
</rss>

