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 149763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:10:56+00:00 2026-05-11T09:10:56+00:00

The production change implementers for our IT group have been tasked with reviewing the

  • 0

The production change implementers for our IT group have been tasked with reviewing the security for all of the various objects in our group, primarily to make sure that people who have left our employ or have transferred to other groups no longer have access to our server shares, web directories, sql databases, etc etc. We recently completed the SQL portion and we have a re-usable script that can be run annually (or at whatever frequency we come up with). It worked great and we audited 20 databases across 10 or so servers withing a few minutes.

Now, for the server stuff. I have an application that I wrote in C# using .NET 2.0 that will recursively scan a list of directories and dump the ACLs to a text file. This works excellent. On the local machine. UNC and Mapped paths do not work, I get the following exception message: The process does not possess the ‘SeSecurityPrivilege’ privilege which is required for this operation.

On this line:

DirectorySecurity DirSec = di.GetAccessControl(AccessControlSections.All); 

Where di is a DirectoryInfo object enumerated from a DirectoryInfo[] array.

We are not likely going to be able to be granted the SeSecurityPrivilege privilege. However I don’t think this should be necessary. I can open the folder and right click for properties and click the security tab and view it in the GUI. I should be able to access it programmatically as well.

Any thoughts on how I can change this section of code to get the permissions for the targeted folder?

private void CheckSecurity(DirectoryInfo[] DIArray) {     foreach (DirectoryInfo di in DIArray)     {         DirectorySecurity DirSec = di.GetAccessControl(AccessControlSections.All);         string sAccessInfo = string.Empty;          foreach (FileSystemAccessRule FSAR in DirSec.GetAccessRules(true, true, typeof(System.Security.Principal.NTAccount)))         {             sAccessInfo += GetAceInformation(FSAR);         }          if (sAccessInfo != string.Empty)         {             // Write info to text file         }     } }  private string GetAceInformation(FileSystemAccessRule ace) {     StringBuilder info = new StringBuilder();     string line = string.Format('Account: {0}', ace.IdentityReference.Value);     info.AppendLine(line);     line = string.Format('Type: {0}', ace.AccessControlType);     info.AppendLine(line);     line = string.Format('Rights: {0}', ace.FileSystemRights);     info.AppendLine(line);     line = string.Format('Inherited ACE: {0}', ace.IsInherited);     info.AppendLine(line);     return info.ToString(); } 

Edit: How would I check the remote folder for the read attrib in the ACL when it fails on getting the ‘GetAccessControl()’ method for the root folder? (If I pass in \server\path, it errors on getting the info for \server\path).

The user account is a domain account and I have permissions to read the file structure. I can view the security from the properties of the folder/files.

I will check out the process monitor but I am not sure that I am going to be able to run it on the server (I am not an admin on the server(s) in question).

  • 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. 2026-05-11T09:10:57+00:00Added an answer on May 11, 2026 at 9:10 am

    Your getting the error because of the ‘Auditing’ tab, though I’m fairly sure all you really want to access on the screen is the data on the ‘Permissions’ tab. The SeSecurityPrivilege controls the access to the SACL.

    Try changing

    DirectorySecurity DirSec = di.GetAccessControl(AccessControlSections.All); 

    to

    DirectorySecurity DirSec = di.GetAccessControl(AccessControlSections.Access); 

    then you should stop getting the error

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

Sidebar

Related Questions

I have uploaded a app in production mode to linode. I want make changes
I have a production Rails 2.3.5 website, and I'd like to the change the
I need to make changes to an in-use production database. Just adding a few
My project invovles me to make a lot of changes on the production code.
Our production environment runs 3 32-Bit Java 6 JVMs on each Windows 2003 server.
Our production environment is: IIS 6.0 .Net framework 4.0 ASP.Net 4.0 thread pool However,
I have been studding GIT for the last couple of weeks in an attempt
I have been trying to use dynamic LINQ to Entity in my application for
I just finished debugging a problem, where our program crashed on a production server,
We currently use Subversion for our release management, and tag all of our releases

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.