This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
networking:windows:active_directory:folder_creation [2017/09/07 16:33] gcooper created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Standardized Active Directory User Folders ====== | ||
- | This is a batch file that quickly creates our standard set of folders for use with: | ||
- | |||
- | * File Shares | ||
- | * Redirected Folders | ||
- | * Roaming Profiles | ||
- | * User Home Directories | ||
- | |||
- | < | ||
- | @echo off | ||
- | rem WARNING! | ||
- | rem This script is intended to be used on a new (data) drive and manhandles permissions on the entire drive! | ||
- | rem | ||
- | set drive=E: | ||
- | set domain=UI | ||
- | net share Homes$ /d /y | ||
- | net share Profiles$ /d /y | ||
- | net share Redirected$ /d /y | ||
- | takeown /F %drive% /R /D Y | ||
- | rmdir /q /s %drive%\$RECYCLE.BIN | ||
- | mkdir %drive%\Shares | ||
- | mkdir %drive%\Homes | ||
- | mkdir %drive%\Profiles | ||
- | mkdir %drive%\Redirected | ||
- | icacls %drive%\Shares /reset /T | ||
- | icacls %drive%\Homes /reset /T | ||
- | icacls %drive%\Profiles /reset /T | ||
- | icacls %drive%\Redirected /reset /T | ||
- | icacls %drive%\Shares / | ||
- | icacls %drive%\Homes / | ||
- | icacls %drive%\Profiles / | ||
- | icacls %drive%\Redirected / | ||
- | |||
- | icacls %drive%\Homes /grant:r " | ||
- | net share Homes$=%drive%\Homes / | ||
- | |||
- | icacls %drive%\Profiles /grant:r " | ||
- | net share Profiles$=%drive%\Profiles / | ||
- | |||
- | icacls %drive%\Redirected /grant:r " | ||
- | net share Redirected$=%drive%\Redirected / | ||
- | |||
- | dir %drive% | ||
- | net share | ||
- | icacls %drive%\*.* | ||
- | |||
- | set drive= | ||
- | set domain= | ||
- | |||
- | echo " | ||
- | |||
- | rem exit | ||
- | </ |