title: NT AUTHORITY\Local Service is not listed in the Access Control List of a directory
body: <p>I'm having this issue where I'm trying to check if NT\Authority Local Service has read\execute permissions on a directory (folder). The product that I work on REQUIRES that the folder the user is installing to has read\execute permissions set for Local Service.</p>
  
  <p>The problem is that when I get the Access Control List (ACL) recursively (groups-within-groups), Local Service is not listed so I can't check if he has permissions to that folder or not.</p>
  
  <p>By default, Local Service does not have read/execute permissions to user profiles (My Documents, Desktop, etc...) but I won't know if Local Service has access to other directories the user chooses to install to.</p>
  
  <p>NOTE: Local Service DOES have access to Program Files, even though it is NOT listed in the ACL. Is it hidden somewhere else?</p>
  
  <p>This is a short snippet on how I'm pulling the ACL:</p>
  
  <pre><code>GroupPrincipal groupPrincipal = 
  GroupPrincipal.FindByIdentity(principalContext, identityReferenceValue);
  
  // GetMembers(true) is recursive (groups-within-groups)
  foreach (var member in groupPrincipal.GetMembers(true)) {
       if (member.SamAccountName.Equals("LOCAL SERVICE")) {
            foundLocalService = true;
             break;
       }
  }
  </code></pre>
  
  <p>Is there any other way I should be doing this? (Other than adding an access rule for Local Service on that directory)
  Is Local Service just not listed in Directories ACL's?</p>
  
  <p>Any help would be greatly appreciated.</p>