Folder and Subfolders Permisions using Scripts



Carlos Santos
07-09-2005, 11:53 PM
Our HR dept. has purchased a new HR software that needs to be installed on
all of our Desktops (600 pc's) the software when installs it gives admin
rights full control to it's app directory and read to everyone group. In
order for the software to work for all users we need to give everyone group
full rights to the app. directory and subdirectory. How can we accomplish
this by using a logon script.

Torgeir Bakken \(MVP\)
07-09-2005, 11:53 PM
Carlos Santos wrote:

> Our HR dept. has purchased a new HR software that needs to be installed on
> all of our Desktops (600 pc's) the software when installs it gives admin
> rights full control to it's app directory and read to everyone group. In
> order for the software to work for all users we need to give everyone group
> full rights to the app. directory and subdirectory. How can we accomplish
> this by using a logon script.
Hi,

A couple of options:

1)
You can use a GPO to set NTFS permissions on files and folders:

Computer Configuration\Windows Settings\Security Settings\File System

Right click on "File System" and select "Add File..." (will work
for folders as well).

You can use variables in your entry's such %SystemDrive% %ProgramFiles%
and so on.


2)
You can also configure a computer startup script that uses cacls.exe
to set permission on the files and folders. This will then be done
each time the computer starts up.

A computer startup script (started with a GPO) runs as part of the
boot up process (before the user logs in). It runs under the system
context and has admin rights.

In your computer startup script GPO, launch a batch file (.bat) that
runs cacls.exe.

I suggest you use the /E switch (edit ACL instead of replacing it.)

For more help on cacls.exe, open a command prompt and run

cacls.exe /?



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx


Folder and Subfolders Permisions using Scripts