Issue to create Virtual directory

Jonathan 480 Reputation points
2026-11-09T09:15:03.72+00:00

Hi,

How to do these on server 2022?

User's image

Windows for business | Windows Server | Directory services | Active Directory

2 answers

Sort by: Most helpful
  1. Ronald Sabiiti 1,670 Reputation points Independent Advisor
    2026-11-09T10:08:27.5166667+00:00

    Hi Jonathan,

    You can create a virtual directory in Windows Server 2022 through IIS Manager. First, ensure the Web Server (IIS) role is installed. Then open IIS Manager, expand Sites, right-click Default Web Site, and select Add Virtual Directory.

    Enter the desired alias and the UNC path to the shared folder (for example, \\ServerName\Sales). If the folder is on another server, configure the appropriate account under Connect as and ensure it has both share and NTFS permissions. Finally, use Test Settings to verify access.

    Here is the reference to Microsoft's documentation for detailed guidance:

    If this information was helpful, please click Accept Answer.

    Thank you for choosing Microsoft Q&A.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-11-09T09:15:40.5133333+00:00

    On Windows Server 2022, create the virtual directory in IIS Manager → Sites → your website → View Virtual Directories → Add Virtual Directory, replacing the legacy New → Virtual Directory wizard shown in the image.

    Create the virtual directory

    1. Sign in to the web server with an administrator account.
    2. Open Server Manager → Tools → Internet Information Services (IIS) Manager.
      • If IIS Manager is unavailable, install the Web Server (IIS) server role first.
    3. In the Connections pane, expand:
      • Your server
      • Sites
      • The target website, such as Default Web Site
    4. Select the website or the application under which the directory should appear.
    5. In the Actions pane, select View Virtual Directories.
    6. Select Add Virtual Directory...
    7. Enter:
      • Alias: the URL segment, such as Sales
      • Physical path: either:
        • Local folder: D:\WebContent\Sales
        • Remote SMB share: \\FileServer\Share\Sales
    8. For a remote share, select Connect as... and enter an account that can access the share.
    9. Select Test Settings.... Both Authentication and Authorization should succeed.
    10. Select OK to create the directory.

    These are the current IIS Manager steps; the virtual-directory configuration used by IIS 10 was not changed from earlier IIS versions.^1^

    Configure a remote UNC folder

    On the file server hosting \\FileServer\Share\Sales:

    1. Share the folder.
    2. Grant the account configured through Connect as... the necessary share permissions.
    3. Grant the same account the necessary NTFS permissions on the folder:
      • Read and execute for read-only web content.
      • Additional modification permissions only if the application must write there.
    4. Use an account with only the permissions required for the content.

    A remote virtual directory requires both appropriate sharing permissions and NTFS permissions.^2^

    Avoid placing a clear-text password directly in ApplicationHost.config; IIS Manager encrypts the password when it writes the configuration.^1^

    Test it

    Browse to:

    http://WebServer/Sales
    

    Replace WebServer with the server name and Sales with the alias. The content from the mapped local folder or UNC share should be returned. The virtual directory inherits configuration and security settings from its parent website.^2^

    If Test Settings reports an authorization failure, correct the remote folder’s share/NTFS permissions or the Connect as... credentials before changing IIS authentication settings.


    References

    1. Virtual Directory <virtualDirectory>
    2. How to create a virtual directory on an existing Web site to a folder that resides on a remote computer
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.