# Give Database Access for GMSA Account

{% embed url="<https://youtu.be/pzLlz31TMsE>" %}

## SQL Script to Give DBOwner rights

To give Sessionlimit Database access to gmsa or any account as dbowner, you can use the script specified below. You should change **DOMAIN\GMSA$** with your domain and credential information.

```sql
USE [master]
GO
CREATE LOGIN [DOMAIN\GMSA$] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
USE [SessionLimit]
GO
CREATE USER [DOMAIN\GMSA$] FOR LOGIN [DOMAIN\GMSA$]
GO
ALTER ROLE [db_owner] ADD MEMBER [DOMAIN\GMSA$]
GO

```
