Skip to content

Instantly share code, notes, and snippets.

@danjpadgett
Created March 20, 2018 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danjpadgett/57837130ebc076e0ea2b9677e5bf190b to your computer and use it in GitHub Desktop.
Save danjpadgett/57837130ebc076e0ea2b9677e5bf190b to your computer and use it in GitHub Desktop.
#Set the Following Parameters
#To be run locally on ConfigMgr Source Server
$Source = 'E:\Source'
$ShareName = 'source$'
$NetworkAccount = 'contoso\SCCMAdmins'
#Create Source Directory
New-Item -ItemType Directory -Path "$Source"
####
#Create Application Directory Structure
# Tiered directory structure indicates licensing model
# T1 = Site licensed applications (MS Office)
# T2 = Individually licensed applications (EG: Creative Cloud, MSProject)
# T3 = Free/OpenSource applications (EG: 7zip, AdobeReader)
# T4 = Misc/Internal/Scripts
# In each case folder can extend levels for Publisher & Application
# EG: \\sccm\source$\Software\T3\Adobe\AcrobatReader
####
New-Item -ItemType Directory -Path "$Source\Software\T1"
New-Item -ItemType Directory -Path "$Source\Software\T2"
New-Item -ItemType Directory -Path "$Source\Software\T3"
New-Item -ItemType Directory -Path "$Source\Software\T4"
#Create Import Directory Structure
New-Item -ItemType Directory -Path "$Source\Import"
New-Item -ItemType Directory -Path "$Source\Import\Baselines"
New-Item -ItemType Directory -Path "$Source\Import\MOFs"
New-Item -ItemType Directory -Path "$Source\Import\Task Sequences"
#Create Log Directory Structure
New-Item -ItemType Directory -Path "$Source\Logs"
New-Item -ItemType Directory -Path "$Source\Logs\MDTLogs"
New-Item -ItemType Directory -Path "$Source\Logs\MDTLogsDL"
#Create OSD Directory Structure
New-Item -ItemType Directory -Path "$Source\OSD"
New-Item -ItemType Directory -Path "$Source\OSD\BootImages"
New-Item -ItemType Directory -Path "$Source\OSD\Branding"
New-Item -ItemType Directory -Path "$Source\OSD\Captures"
New-Item -ItemType Directory -Path "$Source\OSD\DriverPackages"
New-Item -ItemType Directory -Path "$Source\OSD\DriverPackages\Win10"
New-Item -ItemType Directory -Path "$Source\OSD\DriverPackages\Win10\Dell"
New-Item -ItemType Directory -Path "$Source\OSD\DriverPackages\Win10\HP"
New-Item -ItemType Directory -Path "$Source\OSD\DriverSources"
New-Item -ItemType Directory -Path "$Source\OSD\DriverSources\Win10"
New-Item -ItemType Directory -Path "$Source\OSD\DriverSources\Win10\Dell"
New-Item -ItemType Directory -Path "$Source\OSD\DriverSources\Win10\HP"
New-Item -ItemType Directory -Path "$Source\OSD\MDT"
New-Item -ItemType Directory -Path "$Source\OSD\OSImages"
New-Item -ItemType Directory -Path "$Source\OSD\OSInstall"
New-Item -ItemType Directory -Path "$Source\OSD\USMT"
#Create Script Directory Structure
New-Item -ItemType Directory -Path "$Source\Scripts"
#Create Tools Directory Structure
New-Item -ItemType Directory -Path "$Source\Tools"
New-Item -ItemType Directory -Path "$Source\Tools\PSTools"
#Create Windows Update Directory Structure
New-Item -ItemType Directory -Path "$Source\WindowsUpdates"
New-Item -ItemType Directory -Path "$Source\WindowsUpdates\Office"
New-Item -ItemType Directory -Path "$Source\WindowsUpdates\WindowsServer"
New-Item -ItemType Directory -Path "$Source\WindowsUpdates\Windows10"
#Create the Share and Permissions
New-SmbShare -Name "$ShareName” -Path “$Source” -CachingMode None -FullAccess Everyone
#Set Security Permissions example
$Acl = Get-Acl "$Source\Logs"
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule("$NetworkAccount","FullControl", "ContainerInherit, ObjectInherit", "None", "Allow")
$Acl.SetAccessRule($Ar)
Set-Acl "$Source\Logs" $Acl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment