Link to home
Start Free TrialLog in
Avatar of teomcam
teomcam

asked on

Removing "servername\users" permission from multiple folders.

A couple of days ago I had opened another question and found solution partially as follow (bolded)

dir /b >c:\users.txt
for /f %i in (c:\users.txt) do cacls %i /E /C /R "Authenticated users"



Now I need to remove Servername\Users with similar way but the following code did not work.
for /f %i in (c:\folders.txt) do cacls %i /E /C /R "Servername\Users"

So how can I remove Servername\Users permisson from all folders which they are not inherited.
Windows 2008 R2 member server
Avatar of Steven Carnahan
Steven Carnahan
Flag of United States of America image

Try preceeding the "Servername" with a double backslash:  \\
Avatar of teomcam
teomcam

ASKER

Hi,

It did not work.

C:\Users\Administrator\Desktop\Home>for /f %i in (c:\Users.txt) do cacls %i /E /C /R "\\SERVER10\Hom
e$"

C:\Users\Administrator\Desktop\Home>cacls New /E /C /R "\\SERVER10\Home$"
No mapping between account names and security IDs was done.

C:\Users\Administrator\Desktop\Home>cacls New /E /C /R "\\SERVER10\Home$"
No mapping between account names and security IDs was done.

C:\Users\Administrator\Desktop\Home>cacls student1 /E /C /R "\\SERVER10\Home$"
No mapping between account names and security IDs was done.

C:\Users\Administrator\Desktop\Home>cacls student2 /E /C /R "\\SERVER10\Home$"
No mapping between account names and security IDs was done.

C:\Users\Administrator\Desktop\Home>cacls student3 /E /C /R "\\SERVER10\Home$"
No mapping between account names and security IDs was done.

C:\Users\Administrator\Desktop\Home>

Open in new window

"Cacls cannot set the following permissions: change permissions, take ownership, execute, delete use XCACLS to set any of these"
Avatar of teomcam

ASKER

So what's the syntax for it according to info above?

Regards
Avatar of teomcam

ASKER

what's the syntax for it according to info above?
I just read the other thread to see what was going on. After reading that and re-reading this one I think maybe this Microsoft KB might help:

http://support.microsoft.com/kb/180464
ASKER CERTIFIED SOLUTION
Avatar of teomcam
teomcam

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
No objection - just a clarification question so I will know in the future.

So basically it was just that you had it reversed?
Avatar of teomcam

ASKER

Hi pony10us,
 No it wasnt reverse. Look carefully and compare please

cacls %i /E /C /R "servername\users"
cacls Home /T /E /R Users
Okay, I see a difference in switches used:

Added:
    /T            Changes ACLs of specified files in
                  the current directory and all subdirectories.
Removed:
    /C            Continue on access denied errors.
Avatar of teomcam

ASKER

Found the solution at the foreign forum as below.

CD C:\Users\Administrator\Desktop\Home
cacls Home /T /E /R Users