| 1. |
Solve : Setting user permissions on a directory? |
|
Answer» First let me say hi to you all since I just registered and this is my first post. Thanks for your reply! What you NEED, is to change the Access Control List. It doesn't actually change any attributes, but it's an important part of a multi-user network setup. the "cacls" utility is included in XP Pro (if I remember correctly): cacls /T /G username: REPLACE the folder and username with your values of course; is one of R(read),W(write),C(change), or F(Full Control). Quote from: BC_Programmer on July 16, 2010, 05:06:55 AM What you need, is to change the Access Control List. Thanks a bunch, this actually works! This however, brought up another issue that I need to deal with now, which is the following: I have a batch file that does the following: set /P username=Enter a username: mkdir [fileserver]\userdirectories\%username% echo Y|cacls [fileserver]\userdirectories\%username% /T /G [domain]\administrators:F echo Y|cacls [fileserver]\userdirectories\%username% /T /G [domain]\%username%:F <---Which I needed the COMMAND I requested for in the first place When I run the batch file, the directory is created as it should, and the administrators (and other "hard" usernames (such as domaincontrollers, and basically everything that isnt derived from a variable like %username% is permitted to do whatever I gave permissions for. Except, when the batch reaches the point where it needs to give [domain]\%username% permissions, I seem to get an error that says: "No mapping between account names and security IDs was done". I am oblivious of what this means Thanks for your time though, you have helped me great so far!I think I have got it!!! In my original file, I tried to set permissions on a directory on a one-user-per-command kind of base. So... echo Y|cacls [domain]\userdirectories\%username% /T /G [domain]\administrator:F echo Y|cacls [domain]\userdirectories\%username% /T /G [domain]\my-admin-account;F echo Y|cacls [domain]\userdirectories\%username% /T /G [domain]\domaincontrollers:F echo Y|cacls [domain]\userdirectories\%username% /T /G [domain]\%username%:F BUT because cacls always overwrites previously set permissions when you declare new ones, everytime I set a new permission, it would wipe the old ones. This means, that when the command line finally got to the "Give %username% permissions on this map", it would REMOVE my own permissions, thus making me unable to actually GIVE permission on that folder for someone else, seeing as I didn't have any permissions of my OWN anymore. So now, I tried to do this: echo Y|cacls [domain]\userdirectories\%username% /T /G [domain]\account1:F [domain]\account2:f [domain]\account3:F.... and so on and so on in ONE command line. This actually does the job! I owe you much, thanks for your help!! |
|