Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible in IIS to set up a site in IIS and only let users of a certain AD Group get access to it?

share|improve this question
up vote 12 down vote accepted

The following should work, depending on your IIS version. You'll need to add a web.config if you don't have one (though you should on IIS7) in the directory root of your site. The below will allow Domain Admins and deny Domain Users (fairly self explanatory). Make sure you line up the config sections if you already have a section, etc.

  <location path="MyPage.aspx/php/html">
            <allow users="DOMAIN\Domain Admins"/>
            <deny users="DOMAIN\Domain Users"/>

You will need Windows Authentication enabled under Authentication in your site preferences for this to work, obviously, but I assume you already have this enabled.

share|improve this answer
What IIS versions does this work on? – svandragt Sep 2 '14 at 12:22

joshatkins' answer does not work in IIS7. For IIS7, you need to use the role attribute. Also, if you want to restrict the whole site, you don't need the location element.

  <allow roles="DOMAIN\Domain Users"/>
  <deny users="*" />
share|improve this answer
Please don't use references such as "above" or "below" because you have no way of knowing in what order an individual sees the answers. The problem gets worse over time as more answers are posted. You should instead refer to the name of the poster of the answer being referenced. – John Gardeniers Oct 19 '12 at 10:06

Just adding a couple more points to the other answers that helped me figure out how to get this working after I had basic AD Authentication working fine with IIS.

  1. Add Role or Feature via Windows Server Manager: Web Server (IIS) --> Web Server --> Security --> URL Authorization.
  2. Close then reopen the IIS Manager (if you have it open), now you will see (under the IIS Section for your site) Authorization Rules. Open this up.
  3. Click on the right side panel: Add Allow Rule
  4. Under Specified roles or user groups type the name of the AD group you need. eg. myDomain\myGroup and select OK.
  5. Repeat 4 for the groups that you need.

if you just want to edit the configuration file directly, then it would look something like this:

<?xml version="1.0" encoding="UTF-8"?>
                <remove users="*" roles="" verbs="" />
                <add accessType="Allow" roles="myDomain\myGroup01" />
                <add accessType="Allow" roles="myDomain\myGroup02" />
share|improve this answer
You will also need to enable Windows Authentication (NTLM/Kerb). Otherwise if the browser session identity can't be determined, how could the role based authorization work? After following your direction and enabling Windows authentication, this works! – KFL Mar 25 at 6:35

If using the web.config authorization rules do not work (for example because a CGI script runs), you can use the folder permissions system to disable inheritance, remove IIS users (so that nobody has read access) and just add the security group in with read access. You also have to enable some form of authentication method (eg. Basic or Windows Integrated) so that the visitor is recognised.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.