How to Set Visitor Permission Only on Current Site in IIS 8.5

Abstract: Restrict access to specific users on a single IIS 8.5 site without affecting other sites or inheriting parent directory permissions.

Created: 2026-10-13 by

To restrict access to only specific visitors on a single IIS 8.5 site, you must configure the system.webServer/security/authorization section in web.config or use the IIS Manager interface. This approach isolates permissions to the current site, preventing inheritance from parent directories or the server root, ensuring that unauthorized users are denied access while allowing specified accounts or groups to proceed.

Understanding Authorization Rules in IIS 8.5

Before configuring restrictions, it is crucial to distinguish between authentication and authorization. Authentication verifies who the user is, while authorization determines what they can do. In IIS 8.5, the default behavior often allows anonymous access for all sites unless explicitly restricted. To set visitor permissions only on the current site, you need to modify the authorization rules so that they apply exclusively to this web application's scope. The configuration hierarchy in IIS flows from the server level down to the application level. Settings applied at the server level affect all sites, whereas settings in a specific site’s web.config file override parent settings for that site alone. This isolation is key to your requirement of affecting only the current site. If you modify the main applicationhost.config file, you risk impacting other websites hosted on the same IIS instance. Therefore, using site-specific configuration is the safest and most precise method.

Method 1: Using IIS Manager GUI

The graphical interface provides a straightforward way to manage these rules without editing XML files directly. This method is ideal for administrators who prefer visual confirmation of their changes.
  1. Open IIS Manager: Launch the Internet Information Services (IIS) Manager from your Windows Server Start menu or by running iismanager.msc.
  2. Select Your Site: In the Connections pane on the left, expand the server node and click on the specific site you wish to secure. Ensure you do not select the "Sites" folder itself, as that would apply changes globally.
  3. Navigate to Feature Views: In the center pane, locate the Feature View area. Double-click the icon labeled Authorization Rules. If you do not see it, ensure you are viewing the correct feature list for the selected site.
  4. Add Deny Rule: Click Add Deny Rule... in the Actions pane on the right. Set the Access to Deny, choose All users or Anonymous users depending on your security model, and click OK. This creates a baseline restriction.
  5. Add Allow Rule: Immediately after denying general access, click Add Allow Rule.... Specify the Users or Roles that should have access. For example, you might allow a specific Active Directory group like DOMAIN\WebAdmins. Click OK.
When you add an Allow rule after a Deny rule, IIS processes them in order. The first matching rule wins. By placing the Allow rule for specific users above the Deny-all rule, you ensure that authorized visitors can pass through while everyone else is blocked.

Method 2: Editing Web.Config Directly

For developers or those managing infrastructure via code, editing the web.config file offers granular control. This method ensures that the permission settings travel with the application if it is moved to another server. Create or edit the web.config file located in the root directory of your website. You need to insert the authorization element within the system.webServer section. Note that this is different from the older ASP.NET system.web section; IIS 8.5 uses the newer schema for URL authorization.
<configuration>
  <system.webServer>
    <security>
      <authorization>
        <add accessType="Allow" users="DOMAIN\UserOrGroup" />
        <add accessType="Deny" users="?" />
      </authorization>
    </security>
  </system.webServer>
</configuration>
In this snippet, the first line allows the specific user or group. The second line denies access to anonymous users (?). If you want to deny all users except those explicitly allowed, you can use users="*" for the deny rule, but be careful to place the allow rule first. The order of elements matters significantly here. IIS evaluates rules top-down. If you encounter issues where the settings do not apply, check if the web.config is locked at the parent level. Sometimes, administrative locks prevent child sites from overriding global settings. You may need to unlock the configuration section using AppCmd or the IIS Manager UI under Configuration Editor.

Verifying and Troubleshooting Permissions

After applying the rules, it is essential to test the configuration to ensure it works as intended. Use a private browsing window in your web browser to simulate an unauthenticated visitor. Attempt to access the site. If configured correctly, you should receive a 401 Unauthorized or 403 Forbidden error. Then, log in with the credentials of an allowed user and verify that the content loads normally. If the changes do not take effect immediately, consider the following troubleshooting steps:
  • Check Application Pool Identity: Ensure the application pool running your site has sufficient permissions to read the web.config file.
  • Review Inheritance: Use the Edit Features option in IIS Manager to see which settings are inherited from higher levels. You can remove inherited rules if they conflict with your new settings.
  • Clear Browser Cache: Sometimes, browsers cache authentication states. Clearing the cache or using incognito mode helps confirm whether the server is actually rejecting the request.
This targeted approach ensures that your security measures are robust and isolated. It prevents accidental exposure of other sites on your server while providing strict access control for the specific application in question. For more advanced scenarios involving complex role-based access, you might explore integrating with external identity providers, but for standard internal networks, local IIS authorization is sufficient. If you are experiencing issues with file permissions elsewhere on your system, such as being unable to change permissions because the file is being used by another process, you may find relevant guidance in our article on [Cannot change permissions in Windows 10 because the file is being used by another process](/news/1059431/cannot-change-permissions-in-windows-10). However, note that IIS authorization operates at the HTTP layer, distinct from NTFS file system permissions.

Frequently Asked Questions

Does setting authorization in web.config affect subdirectories?

Yes, by default, authorization rules defined in a web.config file apply to the directory containing the file and all its subdirectories. This means if you place the file in the root of your site, all virtual directories under that site will inherit these restrictions unless you create a separate web.config in a subdirectory to override them.

What is the difference between Anonymous and All Users in IIS authorization?

"All Users" includes both authenticated and anonymous users. "Anonymous Users" refers specifically to requests made without any credentials, typically mapped to the IUSR account. If you deny "All Users," you block everyone, including logged-in users, unless you have an explicit allow rule for them. If you deny only "Anonymous Users," authenticated users can still access the site.

Can I use IP addresses instead of user accounts for visitor permissions?

While IIS Authorization Rules primarily focus on user identities, you can achieve IP-based restrictions by using the IP Address and Domain Restrictions feature in IIS Manager. This is a separate module from Authorization Rules and allows you to allow or deny access based on the client's IP address range.

Why am I getting a 401 error even after adding an allow rule?

A 401 error usually indicates an authentication failure rather than an authorization denial. Ensure that the authentication method (e.g., Windows Authentication) is enabled in IIS Manager for the site. If Anonymous Authentication is also enabled, it might be taking precedence. Try disabling Anonymous Authentication if you require strict authentication for all visitors.

How do I revert these changes if something goes wrong?

To revert changes, simply delete the custom web.config file from the site's root directory or remove the authorization section from it. Alternatively, in IIS Manager, go to Authorization Rules, select the rules you added, and click Remove in the Actions pane. This restores the default behavior for that site.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More