Solved

Query for ACLs on a file server

Posted on 2009-04-14
3
354 Views
Last Modified: 2013-12-04
I'm cleaning up all Windows groups associated with a SQL Server database application.  I've verified that I can safely deleted GroupX without any loss of of SQL Server functionality.  However, the application is also associated with thousands of files on the same server, and GroupX may have explicit permissions to some of these files.  Obviously, inspecting each file for GroupX permissions isn't feasible.  Is there a way to query the GroupX ACLs?
0
Comment
Question by:jdana
3 Comments
 
LVL 70

Accepted Solution

by:
Chris Dent earned 125 total points
ID: 24136381

Sure. Install Windows PowerShell (should be under Features in Server Manager), then you can run this (copy and paste after you fix the security principal and base path values.

Chris
# Object name to look for in each access control list

$SecurityPrincipal = "GroupX"

# Starting path

$BasePath = "C:\"
 

# Something to hold the results

$Entries = @()

ForEach ($Entry in (ls -r $BasePath)) {

  If ((Get-ACL -Path $Entry.FullName).Access | `

    ?{ $_.IdentityReference -match $SecurityPrincipal -And $_.IsInherited -eq $False }) { 

      $Entries += $Entry | Select-Object * 

  }

}

# Display the results as a table

$Entries | Format-Table FullName, Name, PSIsContainer, LastAccessTime

# Export Results to a CSV File

$Entries | Export-CSV "Results.csv"

Open in new window

0
 
LVL 2

Assisted Solution

by:gurpreetchhabra
gurpreetchhabra earned 125 total points
ID: 24137099
Or simply try DumpSec GUI based tool to export permissions from a specified root directory, export the result to csv file. Open in excel and filter all results for GroupX.
0
 

Author Closing Comment

by:jdana
ID: 31569822
Both option work great!  Thanks!
0

Featured Post

Why won’t your email signature format correctly?

Struggling to get your corporate email signatures to format correctly? Does the logo keep resizing? Is the text appearing too big? What can you do to prevent this? Find out how you can save your signatures today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How important is it to take extra precautions to protect your online business? These are some steps you can take to make sure you're free of any cyber crime.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now