[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Script to display explicit NTFS perm assignments

Posted on 2008-06-26
3
Medium Priority
?
326 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 2000 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

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

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

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...
Article by: btan
The intent is not to repeat what many has know about Ransomware but more to join its dots of what is it, who are the victims, why it exists, when and how we respond on infection. Lastly, sum up in a glance to share such information with more to help…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

650 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