Ceci est une ancienne révision du document !
Windows
Creation structure dossier
Création de l'Arborescence de Dossiers
- CreateStructure.ps1
# Créer le dossier racine DATA si non existant $rootData = "S:\DATA" if (-not (Test-Path -Path $rootData)) { New-Item -ItemType Directory -Path $rootData } # Liste des dossiers à créer sous S:\DATA $subFolders = @("COMMUN", "PROCESS", "SERVICES") foreach ($folder in $subFolders) { $fullPath = Join-Path -Path $rootData -ChildPath $folder if (-not (Test-Path -Path $fullPath)) { New-Item -ItemType Directory -Path $fullPath } } # Créer les autres dossiers à la racine de S: $otherRootFolders = @("PROFILS", "PRESENTATIONS") foreach ($folder in $otherRootFolders) { $fullPath = "S:\" + $folder if (-not (Test-Path -Path $fullPath)) { New-Item -ItemType Directory -Path $fullPath } }
Création partage réseau
Configuration des Partages de Fichiers
- CreateShares.ps1
## Debug # PS C:\Users\Administrateur.VINCENT> Get-ADGroup -Filter * # PS C:\Users\Administrateur.VINCENT> Get-ADGroup -Identity "GG-Informatique" | Select-Object SID # Partagez les dossiers S:\DATA et S:\PROFILS avec le plus haut niveau de privilèges pour les utilisateurs du domaine New-SmbShare -Name "DATA" -Path "S:\DATA" -FullAccess "vincent\Utilisateurs du domaine" New-SmbShare -Name "PROFILS" -Path "S:\PROFILS" -FullAccess "vincent\Utilisateurs du domaine" # Le dossier S:\PRESENTATIONS doit être partagé avec contrôle total pour les groupes (GG-Informatique, GG-ProdAM, GG-ProdPM) et en lecture pour tous les utilisateurs du domaine. New-SmbShare -Name "PRESENTATIONS" -Path "S:\PRESENTATIONS" -FullAccess "vincent\GG-Informatique","vincent\GG-ProdAM","vincent\GG-ProdPM" -ReadAccess "vincent\Utilisateurs du domaine"
Activation de l'Énumération Basée sur l'Accès
Pour le partage DATA, il était prévu d'activer l'énumération basée sur l'accès (ABE) pour améliorer la sécurité et la gestion des accès.
Set-SmbShare -Name "DATA" -FolderEnumerationMode AccessBased