# 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

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sessionlimit.com/tips-and-tricks/give-database-access-for-gmsa-account.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
