Hyper-V-Backup

4.3

This script creates a full backup of running Hyper-V Virtual Machines.

This script will:

Create a full backup of Virtual Machine(s), complete with configuration, snapshots/checkpoints, and VHD files.

The -List switch should be used to specify a txt file with a list of VM names to backup. If this option is not
configured, all running VMs will be backed up.

If the -
This script creates a full backup of running Hyper-V Virtual Machines.

This script will:

Create a full backup of Virtual Machine(s), complete with configuration, snapshots/checkpoints, and VHD files.

The -List switch should be used to specify a txt file with a list of VM names to backup. If this option is not
configured, all running VMs will be backed up.

If the -NoPerms switch is used, the script will shutdown the VM and copy all the files to the backup location, then start the VM.
You should use the -NoPerms switch if Hyper-V does not have the appropriate permissions to the specified backup location to do an export.
If the -NoPerms switch is NOT used, the script will use the built-in export function, and the VMs will continue to run.

The -Keep switch should be used to keep the specified number of days worth of backups. For example, to keep one months worth of backups
use -Keep 30.

The -Compress switch should be used to generate a zip file of each VM that is backed up. The original backup folder will be deleted afterwards.

Important note: This script should be run on a Hyper-V host. The Hyper-V PowerShell management modules should be installed.

Please note: to send a log file using ssl and an SMTP password you must generate an encrypted
password file. The password file is unique to both the user and machine.

The command is as follows:

$creds = Get-Credential
$creds.Password | ConvertFrom-SecureString | Set-Content c:\foo\ps-script-pwd.txt

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Hyper-V-Backup -RequiredVersion 4.3

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(C) Mike Galvin. All rights reserved.

Package Details

Author(s)

  • Mike Galvin twitter.com/digressive

Tags

Hyper-V Virtual Machines Cluster CSV Full Backup Export Permissions Zip History

Dependencies

This script has no dependencies.

FileList

Version History

Version Downloads Last updated
24.8.29 157 8/30/2024
24.5.11 240 5/11/2024
24.3.21 177 3/21/2024
24.3.18 26 3/18/2024
24.3.8 34 3/11/2024
23.9.5 368 9/16/2023
23.4.28 279 4/28/2023
23.2.18 166 2/18/2023
23.2.7 26 2/9/2023
23.1.9 89 1/9/2023
22.6.22 379 6/22/2022
22.6.18 28 6/18/2022
22.6.17 21 6/17/2022
22.6.11 22 6/14/2022
22.3.26 148 3/27/2022
22.2.8 111 2/9/2022
22.1.19 74 1/20/2022
21.12.28 58 12/28/2021
21.11.9 94 11/12/2021
21.11.5 32 11/5/2021
21.8.10 153 8/10/2021
21.7.2 75 7/2/2021
21.6.14 54 6/14/2021
21.6.2 36 6/2/2021
21.5.30 22 5/30/2021
20.7.13 436 7/26/2020
20.3.20 242 3/20/2020
20.2.28 46 2/28/2020
20.2.14 50 2/17/2020
4.5 159 9/4/2019
4.4 99 5/26/2019
4.3 (current version) 294 6/21/2018
4.2 101 3/4/2018
4.1 27 3/3/2018
4.0 36 1/15/2018
3.9 17 1/12/2018
3.8 17 1/12/2018
3.7 62 10/16/2017
3.6 42 10/6/2017
3.5.1 20 10/5/2017
Show less