Solved

Need a script to reset Windows home dir permissions

Posted on 2010-08-24
2
313 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 82

Expert Comment

by:oBdA
Comment Utility
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
Comment Utility
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now