# Database Permissions

After the IIS configurations and database operations are completed, you should grant the necessary permissions on the SessionAudit database in order for the Application Pools to work. Otherwise, the domain list will not appear at the login page, and the login process will not be possible by any method.

Follow the steps below to grant authorizations:

1. Identify the Application Pool identity from the IIS Application Pools window. In this sample screen shows us, Application Pools works with LocalSystem. It means \[NT AUTHORITY\SYSTEM].
2. Open SQL Server Management Studio screen and connect to SessionAudit server.
3. Grant db\_owner privilege to SessionAudit database for the account given in Application Pool.
4. Sample script is given below. The account used in the Application Pool must be changed at the points where "\[NT AUTHORITY\SYSTEM]" appears in this script. You can use DBPermissons.sql script with the required changes.

<figure><img src="https://2904645777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ipN5tzyFn3WnJYxG6xL%2Fuploads%2FVad3atgARy5NSowCOaJg%2Fimage.png?alt=media&#x26;token=4a6531ca-e264-43ec-aadc-cb9824c97e10" alt=""><figcaption><p>ApplicationPool Identity</p></figcaption></figure>

{% code title="DBPermission.sql" overflow="wrap" lineNumbers="true" %}

```sql
CREATE LOGIN [NT AUTHORITY\SYSTEM] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]
GO
USE [@DBNAME]
GO
ALTER ROLE [db_owner] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
```

{% endcode %}

After running this script, you can check the permissions on SQL Server Management Studio.

<figure><img src="https://2904645777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ipN5tzyFn3WnJYxG6xL%2Fuploads%2Fe08rUREwdnT650o8alLs%2Fimage.png?alt=media&#x26;token=d384d014-6774-4171-99f7-363bbdf3d7ce" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you got an error when running this script about user already exist, you can discard first line of permission sql file.

Also you should change @DBNAME with your SessionAudit database name.
{% endhint %}

You can continue from the point you left in the [Application Pool](https://docs.sessionaudit.com/deployment/single-deployment/iis-and-site-settings) document.
