Jump to content

Set ownership and permissions of homefolders - ICalcs and TAKEOWN


Recommended Posts

Posted

I'm not much of a script writer at all, I currently have

set /p userDir=   Username:



TAKEOWN /f "C:\Home Directories\%userDir%" /r /d y
ICACLS "C:\Home Directories\%userDir%" /reset /T
ICACLS "C:\Home Directories\%userDir%" /grant:r "SERVERNAME\%userDir%":(OI)(CI)M
ICACLS "C:\Home Directories\%userDir%" /setowner "SERVERNAME\%userDir%" /T

 

This works perfect for a single folder at a time, entering the username when prompted but I'd like to run this on a whole year of students, the idea is simple count the number of directories in the location specified. For each dir get the dir name and change the userdir parameter to this for each loop until all have been changed. I'm sure this wouldn't take long for someone who knows the syntax better then me :) I'll give it a go myself but might be beaten on here by other users, you beautifully brainy bunch! :mullet:

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...