Re: Script to check individual permissions



This is making it a little clearer. You can try this batch file.
Watch out for wrapping lines - the "for" loop has only two
lines of code!

@echo off
set source=d:\Shares
set target=c:\Permissions.txt
set User=PeterV

echo Compiling a directory listing
dir /b /ad /s "%source%" > c:\dir.txt

echo Permissions listed on %date% at %time:~0,5% > %target%
echo ======================================================= >> %target%
for /F "tokens=*" %%* in (c:\dir.txt) do (
echo Processing %%*
cacls "%%*" | find /i "%User%" > c:\temp.txt && (echo %%* >>
%target% & type c:\temp.txt >> %target%)
)
notepad %target%



"PV" <PV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0680AE60-F674-4D53-AC2C-B0C66F916C13@xxxxxxxxxxxxxxxx
okay, I am not being clear about my problem.

I want to clean up the permissions on my fileserver. I notice that some
folder-permissions are set to individual users instead of to a group.
So I am looking for a script that checks all folders for permissions, but
only displays that folders with permissions set to individual users.

PV




"Pegasus (MVP)" wrote:

Just use cacls by iteslf!

cacls "d:\Shares\Some Folder\Some File.doc"


"PV" <PV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:38318E80-5457-414E-B860-C0BCFA0E8922@xxxxxxxxxxxxxxxx
Pegasus, thanks for your reply

That does give a better ouput than the subinacl-script

However this lists every file permission on a folder, where I was
looking
only for individual file permissions.
Do you know if that is possible too?

PV

"Pegasus (MVP)" wrote:


"PV" <PV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0061CD49-BAD3-4691-B184-DF66CBFFC188@xxxxxxxxxxxxxxxx
Hi,

Does anyone know of a script that checks individual file
permissions
on a
set of folders?

Whith subinacl you can list al folder permissions
( subinacl /noverbose /nostatistic /outputlog=C:\myfile.txt
/subdirectories
C:\myfolder\ /display ), but as long as the permissions are set to
a
group
I
don't care..

Thanks in advance

Peter

You could run this batch file:

@echo off
set source=d:\Shares
set target=c:\Permissions.txt

echo Compiling a directory listing
dir /b /ad /s "%source%" > c:\dir.txt

echo Permissions listed on %date% at %time:~0,5% > %target%
echo ======================================================= >>
%target%
for /F "tokens=*" %%* in (c:\dir.txt) do (
echo Processing %%*
cacls "%%*" >> %target%
)
notepad %target%








.



Relevant Pages

  • Re: Trying to organize 3k+ folders with a script
    ... images, and they need to be organized into folders by year, then ... Not every day has images. ... echo All done! ... Run the batch file in its "pretend" mode. ...
    (microsoft.public.scripting.vbscript)
  • Re: Trying to organize 3k+ folders with a script
    ... images, and they need to be organized into folders by year, then ... Not every day has images. ... echo All done! ... Press each time the batch file pauses. ...
    (microsoft.public.scripting.vbscript)
  • Re: Script to check individual permissions
    ... I was hoping for a script that would automatically separate users from groups. ... echo Compiling a directory listing ... I want to clean up the permissions on my fileserver. ... only displays that folders with permissions set to individual users. ...
    (microsoft.public.windows.file_system)
  • Re: Delete all files in certain folders across multiple users
    ... scripting period. ... This little batch file will what you want. ... echo Cleaning up user "%*" ... You must determine if it is safe to delete the folders you specified. ...
    (microsoft.public.scripting.vbscript)
  • Re: batch file for share permissions
    ... I am looking for a way to change share permissions on folders ... via a batch file. ... I have found xcacls works fine for security ...
    (microsoft.public.win2000.cmdprompt.admin)