AnsweredAssumed Answered

Using the ListUser function, cannot loop through Two or more Server Geodatabases

Question asked by LarryAdgate on Jun 9, 2016
Latest reply on Jun 9, 2016 by Christian_Wells-esristaff

For our Enterprise Server Geodatabases, the ListUser function works well when using only one Geodatabase, but when looping through two or more Geodatabases is where I need some assistance.

My Script Error: ValueError: Not a valid SDE workspace.

 

 

import arcpy

#Local Variables: I  need to loop through two or More Enterprise Server Geodatabases

 

fc="Arden@gsw_sde.sde", "CowanHeights@gsw_sde.sde"

 

arcpy.env.workspace = "Database Connections/fc"

workspace = arcpy.env.workspace

# get a list of connected users.
userList = arcpy.ListUsers("Database Connections/fc")
for user in users:
    print("Username: {0}, Connected at: {1}".format(user.Name, user.ConnectionTime))

Outcomes