Link to home
Start Free TrialLog in
Avatar of Roginsky
Roginsky

asked on

Changing Permissions on multiple folders for different users easily.

What happened is someone changed the security under all the user profile folders to "everyone" with full permissions and no one else.

These are user folders and the problem is everyone can get into everyone elses data.

What I was hoping is to have a script that would add the user to the folder with full permissions, add administrator with full permissions, and remove everyone.

Anyway to do this easily without having to change them by hand one at a time. Their is 3600 users on this server so we need another option.

Also the folder name is the users name who owns it.
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Roginsky
Roginsky

ASKER

This still won't help me to add the user to have full permissions.

Example if the user name is 10001a then the folder's name is 10001a so I just need that user to have permissions to that folder.

Also it didn't work on the test folders I setup. They still only have "Everyone" and no other groups.
Yes, and that's what this script should do. Did you see the remark about the test mode and removing the ECHO to run it for real? With the ECHO in it, it should just list the xcacls commands it would otherwise run.
Yes I did read what was posted.
Well, what happened? Any error messages?
I get the popup that I am not using cscript engine to run the command. and nothing happens.

I just now add cscript where ECHO use to be.

I get this error.

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Input Error: There is no file extension in "C:\xcacls".
That's a batch script; you need to save it as whatever.cmd, not whatever.vbs.
I edited the file and it works. It was getting an error with the /y option it says no such option.

here is what worked seems to work. it added the correct permissions how I wanted it.

@echo off
setlocal
:: *** Path to the home folder root:
set HomeRoot=\\siena\test
for /d %%a in ("%HomeRoot%\*.*") do (
cscript xcacls.vbs "%%a" /t /g %Userdomain%\%%~nxa:F Administrators:F users:F
  )
and yes I know I saved it as .bat

it wanted the .vbs after xcacls
Sorry, forgot that xcacls is an extra download; check here:
Windows 2000 Resource Kit Tool: Xcacls.exe
http://www.microsoft.com/downloads/details.aspx?FamilyID=7a3e2241-d7d0-42b6-b86e-6eda88726c01&displaylang=en

Otherwise,
echo y| cacls.exe "%%a" /t /g %Userdomain%\%%~nxa:F Administrators:F users:F
should do the trick, too.
Yeah I have xcacls and the echo y didn't work I just used what I put three responses up