This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:windows:active_directory:folder_creation [2017/09/07 16:54] gcooper |
— (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** | ||
- | * **[[networking: | ||
- | * **[[networking: | ||
- | * **[[networking: | ||
- | |||
- | ===== folders.bat ===== | ||
- | |||
- | <note important> | ||
- | |||
- | < | ||
- | @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 | ||
- | rem Edit the next line to place the folders on your choice of disk drive. | ||
- | set drive=E: | ||
- | 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 | ||
- | </ | ||
- | |||
- | ===== Reference ===== | ||
- | |||
- | This command would add Full Access to the " | ||
- | |||
- | < | ||
- | icacls "< | ||
- | </ | ||
- | |||
- | If you add ": | ||
- | |||
- | < | ||
- | icacls "< | ||
- | </ | ||
- | |||
- | The basic permissions are: | ||
- | |||
- | * Full Control (F) | ||
- | * Modify (M) | ||
- | * Read & Execute (RX) | ||
- | * List Folder Contents (X, | ||
- | * Read (R) | ||
- | * Write (W) | ||
- | |||
- | Advanced permissions are: | ||
- | |||
- | * Full Control (F) | ||
- | * Traverse folder / execute file (X) | ||
- | * List folder / read data (RD) | ||
- | * Read attributes (RA) | ||
- | * Read extended attributes (REA) | ||
- | * Create file / write data (WD) | ||
- | * Create folders / append data (AD) | ||
- | * Write attributes (WA) | ||
- | * Write extended attributes (WEA) | ||
- | * Delete subfolders and files (DC) | ||
- | * Delete (D) | ||
- | * Read permissions (RC) | ||
- | * Change permissions (WDAC) | ||
- | * Take ownership (WO) | ||
- | |||
- | You can also specify the inheritance for the folders: | ||
- | |||
- | * This folder only | ||
- | * This folder, subfolders and files (OI)(CI) | ||
- | * This folder and subfolders (CI) | ||
- | * This folder and files (OI) | ||
- | * Subfolders and files only (OI)(CI)(NP)(IO) | ||
- | * Subfolders only (CI)(IO) | ||
- | * Files only (OI)(IO) |