# Active Directory Setup

{% hint style="danger" %}
Active Directory works only when ngSurvey is setup under a Windows Server based configuration
{% endhint %}

Once you have an **already running installation** of ngSurvey on [IIS](broken://pages/-MC7-iY_ntrcidxAGT0x) you may follow the following installation setup to configure Active Directory.

{% hint style="warning" %}
You will still be able to login at any point in time using ngSurvey based accounts even with Active Directory enabled. Both are working in parallel.&#x20;
{% endhint %}

## ⌨️ Manual sign on installation

The manual sign on will require the user to enter their Active Directory credential using a web form. Setting up Active Directory is straightforward as it only requires you to setup the Active Directory Server, Domain and administrative account that can query the server.  To set this settings head to the [system settings](/installation-setup/system-settings.md) page and configure your Active Directory settings.

{% hint style="info" %}
If you would like to support also the single sign on when a user is already logged into its browser you may follow the Single sign on installation setup below after having configured the manual sign on installation.
{% endhint %}

## 👤 Single sign on installation

The first step is to set the database connection string in the web.config of the sub directory called AD. The connection string should be the same as the one you used for your root ngSurvey site.&#x20;

The next step is to add a new application pool inside your IIS manager site.&#x20;

![](/files/-MG986139ZLFcSQJoenw)

Once you have created the new application go to your ngSurvey site root and convert the AD directory to an application.

![](/files/-MG98cXb2UxcReM47-LU)

Set the previously created application pool for your application.

![](/files/-MG98mcNkDmSD0OiFx8W)

Now that you have converted the directory to an application you may change its authentication to Windows authentication only. Make sure to disable anonymous authentication.

![](/files/-MG99-cGrNL6IHad5Ae-)

![](/files/-MG992wRc4E9A4zX2QN7)

That's it existing Active Directory can now use their existing credentials to log into ngSurvey administration or  using the [Active Directory Security](/form-management/security/security-items/active-directory-security.md) to log in ngSurvey forms.


---

# 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.ngsurvey.com/installation-setup/installation/active-directory/active-directory-setup.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.
