Script to add a user to security setting

Can anyone help me with a quick script? I need to add 1 user with full permissions to all the files and folders in our company file structure without removing the security that is in place. I'm not good with scripts and don't know where to start.
Who is Participating?
oBdAConnect With a Mentor Commented:
Open a command prompt, enter the following command, while replacing D:\Root with the root folder you want to change and SomeAccount with the user or group you want to give the permissions to:
cacls "D:\Users" /t /e /g SomeAccount:C
This will change the security settings of "D:\Root": it will *t*raverse (process) subdirectories, *e*dit the current ACLs (instead of replacing them), and *g*rant the account "SomeAccount" *C*hange permissions. (use F for Full access if you prefer that).
Try this on a test folder first until you're comfortable with the command.

Note that it might be advisable to use a group instead of an account. About the only time you give permissions to a dedicated user is the home directory. For any other permissions, there's the AG(D)LP rule:
*A*ccounts go into *G*lobal groups. Global groups go into *L*ocal groups (on the server that hosts the share). *P*ermissions are assigned to the local groups.
In an AD running in native mode, you can use *D*omain local groups instead of "real" local groups.
Ashish PatelCommented:
You mean a VB script for adding user into ADSI?
Ashish PatelCommented:
If yes the please follow the link below.
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

jasonskaggsAuthor Commented:
No this would be an existing user. We have a corporate folder structure comprised of thousands of files and folders with little security inheritance. I need this user to have full security rights to all files and folders.
jasonskaggsAuthor Commented:
Htis works well, however when i run into a file i don't have access to it stops and i have to take ownership which removes the other permissions. Is there anyway past that?
Only the obvious one: use an account that has permissions to all folders.
This is one of the reasons two accounts should have Full permissions on all folders: System and the local Administrators group.
jasonskaggsAuthor Commented:
Thanks i've just been taken ownership. To many people think they are being smart and more secure by removing the system accounts on thier personal folders.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.