<?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: Using the ListUser function, cannot loop through Two or more Server Geodatabases in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377817#M29787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The forward slash represents a path separator. There are many ways to write these paths including raw strings: r'path\folder', double-backslashes: 'path\\folder', or forward slashes 'path/folder'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because a single backward slash can be interpreted as an escape character. Below is a helpful blog in understanding this Python issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pythonconquerstheuniverse.wordpress.com/2008/06/04/gotcha-%E2%80%94-backslashes-in-windows-filenames/" title="https://pythonconquerstheuniverse.wordpress.com/2008/06/04/gotcha-%E2%80%94-backslashes-in-windows-filenames/"&gt;Gotcha — backslashes in Windows filenames | Python Conquers The Universe&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jun 2016 01:04:57 GMT</pubDate>
    <dc:creator>ChristianWells</dc:creator>
    <dc:date>2016-06-10T01:04:57Z</dc:date>
    <item>
      <title>Using the ListUser function, cannot loop through Two or more Server Geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377812#M29782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For our Enterprise Server Geodatabases, the &lt;STRONG&gt;ListUser function&lt;/STRONG&gt; works well when using only one Geodatabase, but when looping through two or more Geodatabases is where I need some assistance.&lt;/P&gt;&lt;P&gt;My Script Error: ValueError: Not a valid SDE workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;#Local Variables: I&amp;nbsp; need to loop through two or More Enterprise Server Geodatabases &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fc="&lt;A href="mailto:Arden@gsw_sde.sde"&gt;Arden@gsw_sde.sde&lt;/A&gt;", "&lt;A href="mailto:CowanHeights@gsw_sde.sde"&gt;CowanHeights@gsw_sde.sde&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = "Database Connections/fc"&lt;/P&gt;&lt;P&gt;workspace = arcpy.env.workspace&lt;/P&gt;&lt;P&gt;# get a list of connected users.&lt;BR /&gt;userList = arcpy.ListUsers("Database Connections/fc")&lt;BR /&gt;for user in users:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("Username: {0}, Connected at: {1}".format(user.Name, user.ConnectionTime))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 16:54:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377812#M29782</guid>
      <dc:creator>LarryAdgate</dc:creator>
      <dc:date>2016-06-09T16:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using the ListUser function, cannot loop through Two or more Server Geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377813#M29783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does looping through the connection list work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;workspaces = ["dbconn1.sde", "dbconn2.sde"]
for sde in workspaces:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = sde
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userList = arcpy.ListUsers(sde)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for user in userList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("Username: {0}, Connected at: {1}".format(user.Name, user.ConnectionTime))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:26:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377813#M29783</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2021-12-11T17:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using the ListUser function, cannot loop through Two or more Server Geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377814#M29784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian-Thanks for you help on this. I'm getting a very Strange Syntax Error just below the print Command. Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;workspaces = ["Arden.sde", "BayPoint.sde"]&lt;/P&gt;&lt;P&gt;for sde in workspaces:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = sde&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; userList = arcpy.ListUsers(sde)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for user in userList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("Username: {0}, Connected at: {1}".format(user.Name, user.ConnectionTime)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 18:26:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377814#M29784</guid>
      <dc:creator>LarryAdgate</dc:creator>
      <dc:date>2016-06-09T18:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using the ListUser function, cannot loop through Two or more Server Geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377815#M29785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like I missed a paren, it should be updated now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 18:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377815#M29785</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2016-06-09T18:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using the ListUser function, cannot loop through Two or more Server Geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377816#M29786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Christain, this is what I finally ended up with and it worked.&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt; Can you please tell me about the Forward slash in the workspace and what this operator is doing? its not division &lt;/P&gt;&lt;P&gt;Thanks Once again,&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;workspaces = ["Database &lt;A href="mailto:Connections/Arden@gsw_sde.sde"&gt;Connections/Arden@gsw_sde.sde&lt;/A&gt;", "Database &lt;A href="mailto:Connections/BayPoint@gws_.sde.sde"&gt;Connections/BayPoint@gws_.sde.sde&lt;/A&gt;"]&lt;/P&gt;&lt;P&gt;for sde in workspaces:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = sde&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; userList = arcpy.ListUsers(sde)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for user in userList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("Username: {0}, Connected at: {1}".format(user.Name, user.ConnectionTime))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 22:40:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377816#M29786</guid>
      <dc:creator>LarryAdgate</dc:creator>
      <dc:date>2016-06-09T22:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using the ListUser function, cannot loop through Two or more Server Geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377817#M29787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The forward slash represents a path separator. There are many ways to write these paths including raw strings: r'path\folder', double-backslashes: 'path\\folder', or forward slashes 'path/folder'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because a single backward slash can be interpreted as an escape character. Below is a helpful blog in understanding this Python issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pythonconquerstheuniverse.wordpress.com/2008/06/04/gotcha-%E2%80%94-backslashes-in-windows-filenames/" title="https://pythonconquerstheuniverse.wordpress.com/2008/06/04/gotcha-%E2%80%94-backslashes-in-windows-filenames/"&gt;Gotcha — backslashes in Windows filenames | Python Conquers The Universe&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2016 01:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-the-listuser-function-cannot-loop-through/m-p/377817#M29787</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2016-06-10T01:04:57Z</dc:date>
    </item>
  </channel>
</rss>

