Bare metal recovery using PowerShell

Source: Internet
Author: User

In the past few versions of Windows Server, Microsoft has increased R & D investment in PowerShell tools to make them available flexibly. In Windows Server 2008 R2 and Windows Server 2012, you can use PowerShell to create a backup that can be used for bare metal recovery. In this article, we will discuss how to operate.

Although it is not necessary to back up bare metal recovery using PowerShell, Microsoft claims that PowerShell is a Windows Server Management Interface recommended by Microsoft, and the traditional graphic-based management method will eventually become a thing of the past. Therefore, system administrators need to master PowerShell to avoid being eliminated by the times.

Recovery Operations for different applications are also different. This document mainly targets backup applications on Windows servers. Of course, some other backup manufacturers also support command line backup operations, but the commands provided by different manufacturers are also different.

Therefore, you need to make some preparations on Windows Server to install the BACKUP command on Windows Server to PowerShell:

In Windows Server 2012, the required PowerShell module is automatically loaded. However, if Windows Server 2008 R2 is used, run the All Modules command to load the required module components.

Increase bare metal recovery capability

The Windows backup policy specifies whether bare metal backup can be created or restored. Therefore, you must first determine whether such a policy exists. You can run the Get-WBPolicy cmdlet command.

If the related Windows backup policy is not displayed, you need to create one. Run the New-WBPolicy cmdlet.

Once a Windows backup policy is created, you must modify the policy to allow bare metal recovery. To make this change, you must be an administrator group or a member of the backup operator group. In addition, before modification, the policy must be set to changeable.

If the New-WBPolicy cmdlet has just been created, the New policy should display a changeable status. If not, you need to add the-editable suffix after the Get-WBPolicy cmdlet command as the parameter.

Once the Windows backup policy is marked as editable, you can use the Add-WBBareMetalRecovery cmdlet to Add bare metal recovery for this policy. During the operation, you also need to add the-policy suffix to specify the corresponding windows backup policy. Generally, the command format is written as follows:

 
 
  1. Add-WBBareMetalRecovery –Policy $policy 

After adding the bare metal recovery function to the Windows backup policy, you also need to confirm whether the operation is successful. The most convenient way is to use the Get-WBBareMetalRecovery cmdlet command to check whether the policy contains the bare metal recovery function. The command format is as follows:

 
 
  1. Get-WBBareMetalRecovery –Policy $policy 

After a policy is created, it is especially convenient to use. You can run the Start-WBBackup cmdlet to complete the backup operation. Simply tell Windows that you want to use the policy you created earlier.

Generally, you also need to specify the backup location, which is basically specified through the New-WBBackupTarget cmdlet command. After the backup is completed, use this command to specify the target location of the backup. For example, you can use the following command to specify a backup target:

 
 
  1. $BackupLocation = New=WBBackupTarget –VolumePath E: 
  2.  
  3. Add-WBBackupTarget –Policy $Policy –Target $BackupLocation 

Once the backup target is specified, the backup process can be started. You can execute the following command:

 
 
  1. Start-WBBackup –Policy $policy 

Although a backup operation has been manually created by this command, the scheduled backup plan can also be easily completed.

Merge these operations

Although we have introduced different command usage methods, I still want to combine these backup creation policies, bare metal recovery, and backup initiation operations. For specific commands, see the following example:

 
 
  1. $policy = New-WBpolicy 
  2.  
  3. Add-WBBareMetalRecovery $policy 
  4.  
  5. $BackupLocation = New-WBBackupTarget –VolumePath E: 
  6.  
  7. Add-WBBackupTarget –Policy $Policy –Target $BackupLocation 
  8.  
  9. Start-WBBackup –Policy $policy 

This article describes how to use PowerShell to create a backup that can be used for bare metal recovery. You can also use similar techniques to implement other types of backup. The Add-WBVolume, Add-WBFileSpec, and Add-WBSystemState functions in Cmdlets can be used to create other types of backups.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.