User Tools

Site Tools


networking:windows:active_directory:folder_creation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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 
- 
-<file> 
-@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 /inheritance:r 
-icacls %drive%\Homes /inheritance:r 
-icacls %drive%\Profiles /inheritance:r 
-icacls %drive%\Redirected /inheritance:r 
- 
-icacls %drive%\Homes /grant:r "ADMINISTRATORS":(OI)(CI)F /grant:r "SYSTEM":(OI)(CI)F /grant:r "CREATOR OWNER":(OI)(CI)(NP)(IO)F /grant:r "AUTHENTICATED USERS":(X,RD,RA,RC,REA) 
-net share Homes$=%drive%\Homes /grant:"ADMINISTRATORS",FULL /grant:"SYSTEM",FULL /grant:"Authenticated Users",FULL 
- 
-icacls %drive%\Profiles /grant:r "ADMINISTRATORS":(OI)(CI)F /grant:r "SYSTEM":(OI)(CI)F /grant:r "CREATOR OWNER":(OI)(CI)(NP)(IO)F /grant:r "EVERYONE":F 
-net share Profiles$=%drive%\Profiles /GRANT:"EVERYONE",FULL 
- 
-icacls %drive%\Redirected /grant:r "ADMINISTRATORS":(OI)(CI)F /grant:r "SYSTEM":(OI)(CI)F /grant:r "CREATOR OWNER":(OI)(CI)(NP)(IO)F /grant:r "EVERYONE":F 
-net share Redirected$=%drive%\Redirected /GRANT:"EVERYONE",FULL 
- 
-dir %drive% 
-net share 
-icacls %drive%\*.* 
- 
-set drive= 
-set domain= 
- 
-echo "Folder structure has been created, permissions set and shares have been shared." 
- 
-rem exit 
-</file> 
networking/windows/active_directory/folder_creation.1504823590.txt.gz · Last modified: 2017/09/07 16:33 by gcooper