Différences
Ci-dessous, les différences entre deux révisions de la page.
| public:add-directory-and-shares-tp [2024/09/11 13:37] – créée - modification externe 127.0.0.1 | public:add-directory-and-shares-tp [2026/06/14 19:15] (Version actuelle) – supprimée vincent1890 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Windows ====== | ||
| - | |||
| - | ===== Creation structure dossier ===== | ||
| - | |||
| - | ==== Création de l' | ||
| - | |||
| - | <file Powershell CreateStructure.ps1> | ||
| - | # Créer le dossier racine DATA si non existant | ||
| - | $rootData = " | ||
| - | if (-not (Test-Path -Path $rootData)) { | ||
| - | New-Item -ItemType Directory -Path $rootData | ||
| - | } | ||
| - | |||
| - | # Liste des dossiers à créer sous S:\DATA | ||
| - | $subFolders = @(" | ||
| - | |||
| - | 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 = @(" | ||
| - | |||
| - | foreach ($folder in $otherRootFolders) { | ||
| - | $fullPath = " | ||
| - | if (-not (Test-Path -Path $fullPath)) { | ||
| - | New-Item -ItemType Directory -Path $fullPath | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | |||
| - | ===== Création partage réseau ===== | ||
| - | |||
| - | ==== Configuration des Partages de Fichiers ==== | ||
| - | |||
| - | <file Powershell CreateShares.ps1> | ||
| - | ## Debug | ||
| - | # PS C: | ||
| - | # PS C: | ||
| - | |||
| - | # Partagez les dossiers S:\DATA et S:\PROFILS avec le plus haut niveau de privilèges pour les utilisateurs du domaine | ||
| - | New-SmbShare -Name " | ||
| - | New-SmbShare -Name " | ||
| - | |||
| - | # Le dossier S: | ||
| - | New-SmbShare -Name " | ||
| - | </ | ||
| - | |||
| - | ==== Activation de l' | ||
| - | Pour le partage DATA, il était prévu d' | ||
| - | Set-SmbShare -Name " | ||
| - | |||
| - | |||