Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need a script to reset Windows home dir permissions

Posted on 2010-08-24
2
Medium Priority
?
326 Views
Last Modified: 2012-05-10
We migrated users over to a new file server.  The folder permissions were lost in translation.  All users home directories are \\lincoln\students\%username%.  I'm in need of a script to take the folder name (username) and give them full control of the folder.  Any suggestions would be greatly appreciated.  Thanks!
0
Comment
Question by:jjacksonwl
2 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 33513195
Assuming Administrators and System already have access, save the script below somewhere on the new server as CorrectHomePerm.cmd or Whatever.cmd, and adjust the "HomeRoot" variable to point to the local path of the shared "students" folder (it's just way faster than over a share).
You can test it, it will currently only print the cacls commands it would normally run. To run it for real (try a test folder with some dummy user folders first), simply remove the capitalized ECHO in front of "cacls".

@echo off
setlocal
set HomeRoot=D:\students
for /d %%a in ("%HomeRoot%\*.*") do (
  echo Processing %%~nxa ...
  ECHO cacls.exe "%%a" /t /e /g "%UserDomain%\%%~nxa":F
)
pause

Open in new window

0
 
LVL 65

Accepted Solution

by:
rockiroads earned 2000 total points
ID: 33513231
MS has something called Xcacls.vbs. This website gives more info, with examples and download link  http://support.microsoft.com/kb/825751

Perphaps a script to take the folder name and supply permissions for each user

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Suggested Courses

972 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