Is there a way to return the list of users locking a distinct geodatabase object (feature class, object table, domain) using python/arcpy ? if there is no way now, can this be added as a new feature..?
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. Seems like that would be a good starting point.
That particular example in my code looks like the following:
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 ]
Edit:
Here is the link to the syntax doc.
Here is a GeoNet post where someone is working through the example I mentioned, & they link back to the original post.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.