Door deze site te gebruiken, u gaat akkoord met de Privacybeleid.
Accepteren
OndernemingOndernemingOnderneming
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
    • Azuur
    • Configmgr/sccm
    • DPM
    • Orkestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kantoor 365
    • Kantoor insider
    • PowerBI
    • Skypen
    • SQL-server
    • Teams
  • VENSTERS
    • Windows-beheercentrum
    • Windows-client
    • Windows-server
  • SCCM-queryverzamelingslijst
Lezing: Hyper-V Virual Machine Restart PowerShell Script
Lettergrootte wijzigenAa
OndernemingOnderneming
Lettergrootte wijzigenAa
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
  • VENSTERS
  • SCCM-queryverzamelingslijst
Zoekopdracht
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
    • Azuur
    • Configmgr/sccm
    • DPM
    • Orkestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kantoor 365
    • Kantoor insider
    • PowerBI
    • Skypen
    • SQL-server
    • Teams
  • VENSTERS
    • Windows-beheercentrum
    • Windows-client
    • Windows-server
  • SCCM-queryverzamelingslijst
Hyper-V

Hyper-V Virual Machine Restart PowerShell Script

Gepubliceerd: Februari 11, 2024
1 Min. gelezen
DEEL

Hyper-V Virtual Machine Restart PowerShell Script. In our company, we use VDI infrastructure with virtual machine pools working at Windows Server Hyper-V 2012 R2. Because we have many GPO, that fast changed and applied to the workstation we need to reboot machines occasionally. But not used machines went to save state if not using about 10 minutes. So we decide to write this script to “reboot machines” at night and create a task in the windows scheduler. As we have 4 pools we create 4 scripts for pools VMs and 4 tasks, that run at night with intervals of 2 hours.

How to:

Because we save not used machines we can’t reboot them, so we do run – shutdown – run – save. Maybe it’s somewhere wrong, but it’s work. This is the Windows PowerShell script:

$VMs = Get-VM 21V-PUBL01-*
Foreach ($VM in $VMs)
{
Start-VM $vm
timeout 60
Stop-VM $vm -passthru
timeout 60
Start-VM $vm
timeout 60
Save-VM $vm
}
GETAGD:Microsoft Hyper-VMicrosoft Windows-serverPowershell
Vorig artikel Install SQL Server 2016 for Configuration Manager
Volgend artikel Sidder: Quickly see which User Profile Disk maps to which Domain User
Laat een reactie achter Laat een reactie achter

Laat een antwoord achter Antwoord annuleren

Uw e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd *

Deze site gebruikt Akismet om spam te verminderen. Ontdek hoe uw reactiegegevens worden verwerkt.

Vertaling

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
door Transposh - Vertaalplugin voor Wordpress

Populaire berichten

Systeemvereisten voor Windows Server 2016
Windows-server
Configuration Manager Queryverzamelingslijst
Configuration Manager Queryverzamelingslijst
ConfiguratieMgr
Gestructureerde/beheerde navigatie ingeschakeld op moderne pagina's in klassieke teamsites
Technologie
SCCM Kan DP-locaties niet ophalen als de verwachte versie van MP
ConfiguratieMgr

Recente berichten

Fail2ban installeren en configureren voor SSH-bescherming op Ubuntu 24.04
Linux
FirewallD inschakelen en configureren op AlmaLinux
Linux
Gebruikers aanmaken en SSH-sleutel instellen in AlmaLinux
Linux
Hoe het wachtwoord op AlmaLinux opnieuw in te stellen
Linux

© 2023 Onderneming

Ga naar mobiele versie
Welkom terug!

Log in op uw account

Gebruikersnaam of e-mailadres
Wachtwoord

Wachtwoord vergeten?