[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Script to add a user to security setting

Posted on 2007-10-10
7
Medium Priority
?
168 Views
Last Modified: 2013-12-04
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.
0
Comment
Question by:jasonskaggs
  • 3
  • 2
  • 2
7 Comments
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20049591
You mean a VB script for adding user into ADSI?
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20049620
If yes the please follow the link below.
http://www.experts-exchange.com/Programming/Misc/Q_21546272.html
0
 
LVL 1

Author Comment

by:jasonskaggs
ID: 20050240
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 20050582
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.
0
 
LVL 1

Author Comment

by:jasonskaggs
ID: 20050825
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?
0
 
LVL 85

Expert Comment

by:oBdA
ID: 20059661
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.
0
 
LVL 1

Author Comment

by:jasonskaggs
ID: 20059967
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.
0

Featured Post

Automating Your MSP Business

The road to profitability.
Delivering superior services is key to ensuring customer satisfaction and the consequent long-term relationships that enable MSPs to lock in predictable, recurring revenue. What's the best way to deliver superior service? One word: automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ransomware, the malware that locks down its victim’s files until they pay up, has always been a frustrating issue to deal with. However, a recent mobile ransomware will make the issue a little more personal… by sharing the victim’s mobile browsing h…
Phishing emails are a popular malware delivery vehicle for attack.  While there are many ways for an attacker to increase the chances of success for their phishing emails, one of the most effective methods involves spoofing the message to appear to …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question