Skip to content

Commit cee8f33

Browse files
committed
Modification1
1 parent d5692f0 commit cee8f33

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

nassiratou.ps1

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#activer hyper-v
2+
enabled-WindowsOptionalFeature -Online -FeatureName Microsoft-hyper-v-all
3+
#verifier les cartes réseaux
4+
Get-NetAdapter
5+
#création d'un switch externe
6+
New-VMSwitch -name Externe -NetAdapterName WI-FI
7+
#création de switch privé
8+
New-VMSwitch -name MPIO1 -SwitchType Private
9+
New-VMSwitch -name MPIO2 -SwitchType Private
10+
New-VMSwitch -name Pulsation -SwitchType Private
11+
#création de switch interne
12+
New-VMSwitch -name Interne -SwitchType Internal
13+
14+
15+
16+
#Création d'une VM ( Master)
17+
18+
New-VM -Name Master -MemoryStartupBytes 6GB -Path c:\hyper-v\Master -NewVHDPath C:\Hyper-V\Master\Master.vhdx -Generation 2 -SwitchName interne -NewVHDSizeBytes 200GB
19+
#Activer les services d'invité (tools)
20+
Enable-VMIntegrationService -VMName Master -Name Interface*
21+
#modifier le nombre de CPU
22+
Set-VM -Name Master -ProcessorCount 2
23+
#desactiver le point de control ( désactiver le snapshot)
24+
Set-VM -Name Master -CheckpointType Disabled
25+
26+
27+
28+
#Procedure pour le sysprep (enlever les parametres specifique à une machine en vue de le deployer ou de le cloner )
29+
cd C:\windows\system32\sysprep
30+
taper .\sysprep.exe /generalize /oobe /shutdown
31+
ou
32+
C:\windows\system32\sysprep\sysprep.exe /generalize /oobe /shutdown
33+
34+
35+
#mettre disque de Master en lecture seul (Read Only)
36+
#creation de disque de différenciation à partir d'un Parent
37+
38+
New-VHD -Path C:\Hyper-V\Hote-01\Hote-01.vhdx -ParentPath c:\hyper-v\master\master.vhdx -Differencing
39+
New-VHD -Path C:\Hyper-V\Hote-02\Hote-02.vhdx -ParentPath c:\hyper-v\master\master.vhdx -Differencing
40+
New-VHD -Path C:\Hyper-V\Hote-03\Hote-03.vhdx -ParentPath c:\hyper-v\master\master.vhdx -Differencing
41+
New-VHD -Path C:\Hyper-V\DC-01\DC-01.vhdx -ParentPath c:\hyper-v\master\master.vhdx -Differencing
42+
43+
#creation de VMs à partir de disque de differenciation
44+
New-VM -Name Hote-03 -MemoryStartupBytes 6GB -Path c:\hyper-v\Hote-03 -VHDPath C:\Hyper-V\Hote-03\Hote-03.vhdx -Generation 2 -SwitchName interne
45+
New-VM -Name Hote-02 -MemoryStartupBytes 6GB -Path c:\hyper-v\Hote-02 -VHDPath C:\Hyper-V\Hote-02\Hote-02.vhdx -Generation 2 -SwitchName interne
46+
New-VM -Name Hote-01 -MemoryStartupBytes 6GB -Path c:\hyper-v\Hote-01 -VHDPath C:\Hyper-V\Hote-01\Hote-01.vhdx -Generation 2 -SwitchName interne
47+
New-VM -Name DC-01 -MemoryStartupBytes 6GB -Path c:\hyper-v\DC-01 -VHDPath C:\Hyper-V\DC-01\DC-01.vhdx -Generation 2 -SwitchName interne
48+
Enable-VMIntegrationService -VMName DC-01, Hote-01, hote-02, hote-03 -Name Interface*
49+
Set-VM -Name DC-01, Hote-01, hote-02, hote-03 -ProcessorCount 2
50+
Set-VM -Name DC-01, Hote-01, hote-02, hote-03 -CheckpointType Disabled

0 commit comments

Comments
 (0)