Get-DbaDatabaseUser

Gets database users

Screenshots

dbatools - Get-DbaDatabaseUser

Examples

Gets all database users

Get-DbaDatabaseUser -SqlInstance sql2016

Gets the users for the db1 database

Get-DbaDatabaseUser -SqlInstance Server1 -Database db1

Gets the users for all databases except db1

Get-DbaDatabaseUser -SqlInstance Server1 -ExcludeDatabase db1

Gets the users for all databases that are not system objects, like ‘dbo’, ‘guest’ or ‘INFORMATION_SCHEMA’

Get-DbaDatabaseUser -SqlInstance Server1 -ExcludeSystemUser

Gets the users for the databases on Sql1 and Sql2/sqlexpress

‘Sql1′,’Sql2/sqlexpress’ | Get-DbaDatabaseUser

Author

This command was created by Klaas Vandenberghe. You can find Klaas on Twitter and his blog.