Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6586379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:47:00+00:00 2026-05-25T16:47:00+00:00

I have the following code ( from msdn ) to set file permissions: ‘

  • 0

I have the following code (from msdn) to set file permissions:

' Adds an ACL entry on the specified file for the specified account.
Sub AddFileSecurity(ByVal fileName As String, ByVal account As String, ByVal rights As FileSystemRights, ByVal controlType As AccessControlType)

    ' Get a FileSecurity object that represents the 
    ' current security settings.
    Dim fSecurity As FileSecurity = File.GetAccessControl(fileName)

    ' Add the FileSystemAccessRule to the security settings. 
    Dim accessRule As FileSystemAccessRule = New FileSystemAccessRule(account, rights, controlType)

    fSecurity.AddAccessRule(accessRule)

    ' Set the new access settings.
    File.SetAccessControl(fileName, fSecurity)

End Sub

I call this using the group IIS_IUSRS (I’ve tried ComputerName/IIS_IUSRS too) and I’m trying to apply FileSystemRights.FullControl

But results in this error:

System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated

Which suggests IIS_IUSRS doesn’t exist (it does). My next step is to output the users and groups on the machine to see what my code thinks does exist. In the mean time does anyone know why, or what is causing this?

This code works fine on my local machine but not when run on my web server. The app pool runs as network service and Network Server has FULL permission on the folder the files are in. I noticed this question that suggests the user needs permission on the directory – but this isn’t the problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:47:01+00:00Added an answer on May 25, 2026 at 4:47 pm

    To work around this, change the authentication on the website to run as “Same as app pool” (as opposed to anonymous). Not the best answer, but have tried everything else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got the following code from here to read an Excel file using
I have the following code, which is a modified version from MSDN's website, to
I have the following code: from selenium import selenium selenium = selenium(localhost, 4444, *chrome,
I have the following code (inherited from someone): <div class=feedback>&nbsp;</div> <form onsubmit=return false autocomplete=off>
So I have the following code: return from a in DBContext.Acts join artist in
I have the following code import smtplib from email.mime.text import MIMEText smtpserver = 'smtp.gmail.com'
I have the following piece of code from a book. There is this function
I have the following code for adding to/extracting from Zip. I'm trying to refactor
I have the following piece of code taken from the PHP manual on the
Hi I have following XAML code which is the output from XamlWriter.Save(): <StackPanel Name=itemStack

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.