Solved

Need a script to reset Windows home dir permissions

Posted on 2010-08-24
2
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 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