Solved

Script to display explicit NTFS perm assignments

Posted on 2008-06-26
3
315 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
  • 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

The term "Bad USB" is a buzz word that is usually used when talking about attacks on computer systems that involve USB devices. In this article, I will show what possibilities modern windows systems (win8.x and win10) offer to fight these attacks wi…
SHARE your personal details only on a NEED to basis. Take CHARGE and SECURE your IDENTITY. How do I then PROTECT myself and stay in charge of my own Personal details (and) - MY own WAY...
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

809 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