Jump to content

Setting user share NTFS permissions en masse


Was this script useful  

3 members have voted

  1. 1. Was this script useful



Recommended Posts

Posted

This script is a development of a piece of work by ChrisH.

 

You need to extract the files and edit the script so that it knows where your user shares are and what permissions to give out. It assumes that the folder names are the same as the usernames.

 

The script runs through all the folders setting permissions and ownership on the files/folders within.

 

I ACCEPT NO RESPONSIBILITY IF THIS SCRIPT BUGGERS ANYTHING UP SO TEST THOROUGHLY!

permissions_115.rar

Posted

Needs some constants in it for some of the settings I reckon :wink:

 

My add user script needs a bit of development as well if your in the scripting mood Ric :D

Posted

@ChrisH: You wrote it (for your adduser script), I just hacked it and refined it for use on previously created folders. ;)

 

I spose I could add the constants but I know that this definately works... as opposed to maybe working if I tinker too much.

Posted

blimey! All that vb seems a bit longwinded to me! Mine's a windows batch file:

 

for /f "Tokens=*" %%i in ('dir /b /ad "E:\year7\"') do subinacl /subdir "E:\year7\%%i\*.*" /setowner=mydomain\%%i

 

(one line per parent folder) to do the ownership. It could be tweaked easily to take an argument on the commandline, but I feel safer using hard-coded values. You need to use a recent version of subinacl (mine is 5.2.3790.1180)

 

To give the folder's owner NTFS full control, I do:

 

for /f "Tokens=*" %%i in ('dir /b /ad "\\myserver\year7\"') do @cacls "\\myserver\year7\%%i" /E /T /G "mydomain\%%i":f

 

Having them separate is handy because it can take a long time to run these through.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...