Outils pour utilisateurs

Outils du site


windows:memo_commandes_hyper-v

Mémo Commandes Hyper-V

Hyper-V

Activer l'accès Remote Desktop :

Cscript %windir%\system32\SCRegEdit.wsf /ar 0

Désactiver l'accès Remote Desktop :

Cscript %windir%\system32\SCRegEdit.wsf /ar 1

VM

Lister

Get-VM

Démarrer :

Start-VM -Name 'NOM'

Arrêter:

Stop-VM -Name 'NOM'

Redémarrer :

Restart-VM -Name 'NOM'

Forcer l'arrêt :

Stop-VM -Name 'NOM' –Force

Montrer à une VM les capacité de virtualisation du Processeur physique. (Virtualiseur sans une VM)

Set-VMProcessor -VMName NOM_VM -ExposeVirtualizationExtensions $true

Réseau

Afficher les interface réseaux physique disponible :

Get-NetAdapter

Identifier les cartes réseaux :

Get-NetAdapter | Select Name, InterfaceDescription, MediaConnectionState | FL

Créer un VMSwitch :

New-VMSwitch "NOM_DU_VMSwitch" -NetAdapterName "NOM_INTERFACE_RESEAU"

Création d'un VSwitch avec plusieurs interface physique

New-VMSwitch -Name "TeamedvSwitch" -AllowManagementOS $true -NetAdapterName "NOM_INTERFACE1","NOM_INTERFACE2" -EnableEmbeddedTeaming $true

Afficher le nom des VMswitchs :

Get-VMSwitch  * | Format-Table Name 

Afficher le nom des VMSwitchs et des interface réseau attachées :

Get-VMSwitch  *

Création d'une nouvelle Machine Virtuelle en attachant un VHDx existant :

New-VM -name NOM_VM -MemoryStartupBytes 2GB -BootDevice VHD -VHDPath C:\CHEMIN_VERS.VHDX -Generation 2 -SwitchName "NOM_VSWITCH"
windows/memo_commandes_hyper-v.txt · Dernière modification : 2022/12/01 10:56 de sheltem