Solved

Script to display explicit NTFS perm assignments

Posted on 2008-06-26
3
318 Views
Last Modified: 2013-12-04
Does anyone have a script (preferably a VB script) that I can run on a Windows Server 2003 that will prompt for a user name or group name and then print a list of every folder and file where that user or group has an explicit NTFS permissions assignment?

You would be king (or Queen as the case may be)
0
Comment
Question by:santaspores1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:santaspores1
ID: 21877877
Or.. maybe you know of an app that does this.  Not AccessEnum though - I want something that is user/group oriented.  AccessEnum just lets you point to a folder and lists the perms on that folder.  I want to enter a user and group and know ALL of the folders and files that user/group has EXPLICIT perm assignments for...
0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 total points
ID: 21879405
Here is a batch script which should accomplish what you want.

Paste the script below into a text file with a .cmd extension.  Customize the value of the "root" variable with the directory to search under.  Running the script will prompt for the user or group name and then echo back any files or folders with explicit permissions set.


@echo off
setlocal enabledelayedexpansion
 
set root=d:\files
 
echo Enter the user or group name to search for, e.g. YOURDOMAIN\jdoe
set /P name=Name: 
 
for /F "tokens=*" %%G in ('dir "%root%" /B /S') do (
 for /F "tokens=*" %%H in ('cacls "%%G"') do (
  set output=%%H
  set output=!output:*%name%=FOUND!
  if "!output:~0,5!"=="FOUND" echo %%G
 )
)
 
pause

Open in new window

0
 

Author Closing Comment

by:santaspores1
ID: 31471045
You rock!  Thanks ever so much Shift!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mitigation for Win 10 user account bypass 8 123
Why can't I delete this folder? 6 129
Share and Advanced Sharing permissions 8 141
PCI scan - CIFS NULL Session Permitted 10 189
In today's information driven age, entrepreneurs have so many great tools and options at their disposal to help turn good ideas into a thriving business. With cloud-based online services, such as Amazon's Web Services (AWS) or Microsoft's Azure, bus…
Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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