Select to view content in your preferred language

List Database Users

220
2
06-10-2024 02:17 PM
TylerT
by
Occasional Contributor III

Hello,

I am using Create Database User here:
https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-database-user.htm

and now have the need to list these same database users.  Is there a tool for listing database users?   

I see this tool... https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listusers.htm but this seems to list a different type of user (a connected user by id).

Thank you,

Tyler

0 Kudos
2 Replies
ChrisUnderwood
Esri Contributor

Hello @TylerT , the Create Database User tool makes the user in the database itself, it doesn't create anything on the Esri side. So the best way to list all the database users is from the database side, eg using SQL, or a database management tool.

From ArcGIS Pro, you can use the Catalog pane to right-click on a Feature Class you own. Then select Privileges > Add User. That will return a form showing the database users, which might meet your needs.

ChrisUnderwood_0-1718286213336.png

 

 

0 Kudos
George_Thompson
Esri Notable Contributor
SELECT * FROM sys.database_principals

This code in SQL should return all the user names in a specific database. This would include DB roles, etc.

--- George T.