Start-WBBackup
Starts a one-time backup operation.
Syntax
Description
The Start-WBBackup cmdlet starts a one-time backup operation.
You can use the settings from an existing backup policy for the scheduled backup by specifying a WBPolicy object, or you can start a backup by using new settings. If you use new settings to create a backup, you must do the following:
- Specify the items to include in the backup by using the Add-WBVolume, Add-WBFileSpec, Add-WBSystemState, and Add-WBBareMetalRecovery cmdlets.
- Specify the location for backup storage by using the locations already defined in a WBBackupTarget object or by updating an object of that type.
Before you can add a backup target to a WBPolicy object, put the WBPolicy object in edit mode. To put the WBPolicy object in edit mode for a policy that you have set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the Editable parameter. The Get-WBPolicy cmdlet creates a new WBPolicy object that is already in edit mode.
To use this cmdlet, you must be a member of the Administrators group or Backup Operators group.
Examples
Example 1: Start a backup by using new settings
This example starts a backup by using new settings.
Example 2: Start a backup by using backup policy settings
This example starts a backup by using the settings for scheduled backups defined in a backup policy.
The first command gets the current backup policy and stores it in the variable named $Policy.
The second command starts the backup. Because the command specifies the Async parameter, the cmdlet returns immediately.
The third command gets the backup status and stores it in the variable named $BackupJob. Because the second command includes the Async parameter, you can view the backup status by using the Get-WBJob cmdlet.
Parameters
Indicates that the cmdlet deletes backups of older versions of the operating system.
Type: | SwitchParameter |
Position: | 3 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that Windows PowerShell returns immediately after the backup starts and does not display status messages. If you specify this parameter and choose not to display status messages, you can use the Get-WBJob cmdlet to get the status of the currently running backup operation.
Type: | SwitchParameter |
Position: | 1 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Do not use. This parameter is not implemented in this version of the module.
Type: | SwitchParameter |
Position: | 4 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Forces the command to run without asking for user confirmation.
Type: | SwitchParameter |
Position: | 2 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a WBPolicy object that includes the policy settings for the backup by using an existing backup policy object.
Type: | WBPolicy |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
WBPolicy
This cmdlet uses a WBPolicy object to determine what to include in the backup and where to store the backup.
Outputs
String
If you do not specify the Async parameter, this cmdlet displays status messages from the currently running backup as strings. If you specify the Async parameter, you can use the Get-WBJob cmdlet to get the status of the currently running backup operation.
Windows Server Backup
This reference provides cmdlet descriptions and syntax for all Windows Server Backup cmdlets. It lists the cmdlets in alphabetical order based on the verb at the beginning of the cmdlet.
WindowsServerBackup
Adds a backup target to a backup policy.
Adds items to a backup policy so that backups that use the policy can perform bare metal recoveries.
Adds a backup file specification to a backup policy.
Adds the system state components to the backup policy.
Adds a list of virtual machines to the backup policy.
Adds the list of source volumes to the backup policy.
Gets backups for a server from a location that you specify.
Gets backup storage locations that you specified as part of a backup policy.
Mounts a volume inside a backup so that you can browse the files on the volume.
Gets a Boolean value that indicates whether or not a backup policy can perform bare metal recoveries from backups.
Gets a list of internal and external disks that are online for the local computer.
Gets the list of backup file specifications associated with a backup policy.
Gets the current backup operation.
Gets the current volume backup performance settings.
Gets the current backup policy for the computer.
Gets the current schedule for backups.
Gets the history of backup operations on the computer.
Gets a Boolean value that indicates whether system state recovery was added to the backup policy.
Gets all virtual machines and components from the backup policy.
Gets a list of volumes.
Gets a VSS setting from the backup policy.
Creates a backup target object.
Creates a backup file specification.
Creates a backup policy object.
Removes backups from a target catalog, a system catalog, or both.
Removes backup storage locations from a backup policy.
Removes a request to include items that implement bare metal recovery from the current backup policy.
Removes the backup catalog from the local computer.
Removes a backup file specification from a backup policy.
Removes the backup policy.
Removes the system state components from the backup policy.
Removes the list of virtual machines from the backup policy.
Removes the volume from the backup policy.
Restores a backup catalog for the local computer from a storage location.
Resumes a backup operation to a removable device after you add media to the device.
Resumes a volume recovery operation from a removable device and specific media.
Sets the current volume backup performance settings.
Sets the backup policy for scheduled backups.
Sets the current schedule for backups.
Sets a value that determines the VSS setting in the backup policy.
Starts an application recovery operation.
Starts a one-time backup operation.
Starts a file recovery operation.
Starts recovery of a Hyper-V Server 2016 virtual machine.
Командлеты Windows PowerShell для резервного копирования и восстановления ЦС CA Backup and Restore Windows PowerShell cmdlets
Область применения. Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Applies To: Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Автор: Джастин Тернер, старший инженер по расширению поддержки с группой Windows Author: Justin Turner, Senior Support Escalation Engineer with the Windows group
Этот материал создан инженером службы поддержки клиентов Майкрософт и предназначен для опытных администраторов и архитекторов систем, которым нужны более глубокие технические сведения о функциях и решениях в Windows Server 2012 R2, а не обычная информация, доступная в статьях на сайте TechNet. This content is written by a Microsoft customer support engineer, and is intended for experienced administrators and systems architects who are looking for deeper technical explanations of features and solutions in Windows Server 2012 R2 than topics on TechNet usually provide. Однако он не был отредактирован согласно требованиям сайта, поэтому некоторые формулировки могут быть не такими выверенными, как на станицах TechNet. However, it has not undergone the same editing passes, so some of the language may seem less polished than what is typically found on TechNet.
Обзор Overview
Модуль Адксадминистратион Windows PowerShell появился в Window Server 2012. The ADCSAdministration Windows PowerShell module was introduced in Window Server 2012. В этот модуль в Windows Server 2012 R2 были добавлены два новых командлета для поддержки резервного копирования и восстановления центра сертификации. Two new cmdlets were added to this module in Window Server 2012 R2 to support the Backup and Restore of a CA.
Backup-CARoleService Backup-CARoleService
Таблица SEQ таблица \ * арабский 17: командлеты Backup и RESTORE Windows PowerShell Table SEQ Table \* ARABIC 17: Backup and Restore Windows PowerShell Cmdlets
Командлет Адксадминистратион: Backup-Каролесервице ADCSAdministration Cmdlet: Backup-CARoleService
Аргументы — требуются аргументы полужирного шрифта Arguments — Bold arguments are required | Description Description |
---|---|
-Path -Path | -Строка — место для сохранения резервной копии — String — location to save the backup — Это единственный безымянный параметр. — This is the only unnamed parameter -Позиционированный параметр — positional parameter Пример. Example: Backup-Каролесервице.-путь c:\adcsbackup1 Backup-CARoleService.-Path c:\adcsbackup1 Backup-Каролесервице c:\adcsbackup2 Backup-CARoleService c:\adcsbackup2 |
-Кэйонли -KeyOnly | — Резервное копирование сертификата ЦС без базы данных; — Backup the CA certificate without the database Пример. Example: Backup-Каролесервице c:\adcsbackup3-Кэйонли Backup-CARoleService c:\adcsbackup3 -KeyOnly |
-Password -Password | — Указывает пароль для защиты сертификатов ЦС и закрытых ключей. — Specifies the password to protect CA certificates and private keys — Должна быть защищенной строкой — Must be a secure string -Недопустимо с параметром-Датабасеонли — Not valid with the -DatabaseOnly parameter Backup-Каролесервице c:\adcsbackup4-пароль (чтение-хост-запрос «пароль:»-AsSecureString) Backup-CARoleService c:\adcsbackup4 -Password (Read-Host -prompt «Password:» -AsSecureString) Backup-Каролесервице c:\adcsbackup5 — Password (ConvertTo-SecureString «Pa55w0rd!» Backup-CARoleService c:\adcsbackup5 -Password (ConvertTo-SecureString «Pa55w0rd!» -AsPlainText-Force) -AsPlainText -Force) |
-Датабасеонли -DatabaseOnly | — Резервное копирование базы данных без сертификата ЦС; — Backup the database without the CA certificate Backup-Каролесервице c:\adcsbackup6-Датабасеонли Backup-CARoleService c:\adcsbackup6 -DatabaseOnly |
-Force -Force | 1. позволяет перезаписать резервную копию, которая существует в расположении, указанном в параметре-Path. 1. Allows you to overwrite the backup that preexists in the location specified in the -Path parameter Backup-Каролесервице c:\adcsbackup1 — Force Backup-CARoleService c:\adcsbackup1 -Force |
-Добавочное -Incremental | -Выполнить добавочное резервное копирование — Perform an incremental backup Backup-Каролесервице c:\adcsbackup7 — добавочный Backup-CARoleService c:\adcsbackup7 -Incremental |
-Киплог -KeepLog | 1. указывает команде на необходимость сохранения файлов журнала. 1. Instructs the command to keep log files. Если параметр не указан, файлы журнала усекаются по умолчанию, за исключением случая добавочного сценария. If the switch is not specified, log files are truncated by default except in the Incremental scenario Backup-Каролесервице c:\adcsbackup7-Киплог Backup-CARoleService c:\adcsbackup7 -KeepLog |
-Password -Password
Если используется параметр-Password, указанный пароль должен быть защищенной строкой. If the -Password parameter is used, the supplied password must be a secure string. Используйте командлет Read-Host для запуска интерактивного запроса на ввод безопасного пароля или используйте командлет ConvertTo-SecureString , чтобы указать пароль в строке. Use the Read-Host cmdlet to launch an interactive prompt for secure password entry, or use the ConvertTo-SecureString cmdlet to specify the password in-line.
Ознакомьтесь со следующими примерами. Review the following examples
Указание защищенной строки для параметра пароля с помощью командлета Read-Host Specifying a secure string for the Password parameter using Read-Host
Указание защищенной строки для параметра Password с помощью ConvertTo-SecureString Specifying a secure string for the Password parameter using ConvertTo-SecureString
Restore-CARoleService Restore-CARoleService
Командлет Адксадминистратион: Restore-Каролесервице ADCSAdministration Cmdlet: Restore-CARoleService
Аргументы — требуются аргументы полужирного шрифта Arguments — Bold arguments are required | Description Description |
---|---|
-Path -Path | -Строка — расположение для восстановления резервной копии — String — location to restore backup from — Это единственный безымянный параметр. — This is the only unnamed parameter -Позиционированный параметр — positional parameter Пример. Example: Restore-Каролесервице.-path c:\adcsbackup1 — Force Restore-CARoleService.-Path c:\adcsbackup1 -Force Restore-Каролесервице c:\adcsbackup2-Force Restore-CARoleService c:\adcsbackup2 -Force |
-Кэйонли -KeyOnly | — Восстановить сертификат ЦС без базы данных; — Restore the CA certificate without the database — Необходимо указать, если резервная копия была сделана с параметром-Кэйонли — Must be specified if the backup was taken with the -KeyOnly option Пример. Example: Restore-Каролесервице c:\adcsbackup3-Кэйонли-Force Restore-CARoleService c:\adcsbackup3 -KeyOnly -Force |
-Password -Password | — Указывает пароль сертификатов ЦС и закрытых ключей. — Specifies the password of the CA certificates and private keys — Должна быть защищенной строкой — Must be a secure string Пример. Example: Restore-Каролесервице c:\adcsbackup4-Password (чтение-хост-запрос «пароль:»-AsSecureString)-Force Restore-CARoleService c:\adcsbackup4 -Password (read-host -prompt «Password:» -AsSecureString) -Force Restore-Каролесервице c:\adcsbackup5-Password (ConvertTo-SecureString «Pa55w0rd!» Restore-CARoleService c:\adcsbackup5 -Password (ConvertTo-SecureString «Pa55w0rd!» -AsPlainText-Force) — Force -AsPlainText -Force) -Force |
-Датабасеонли -DatabaseOnly | Восстановление базы данных без сертификата ЦС — Restore the database without the CA certificate Restore-Каролесервице c:\adcsbackup6-Датабасеонли Restore-CARoleService c:\adcsbackup6 -DatabaseOnly |
-Force -Force | — Позволяет перезаписать существующие ключи — Allows you to overwrite the preexisting keys — Необязательный параметр, но при восстановлении на месте, скорее всего, требуется — Is an optional parameter but when restoring in-place, it is likely required Restore-Каролесервице c:\adcsbackup1-Force Restore-CARoleService c:\adcsbackup1 -Force |
Проблемы Issues
Резервная копия, не защищенная паролем, создается, если функция ConvertTo-SecureString завершается сбоем при использовании параметра Backup-Каролесервице с параметром-password. A non-password protected backup is taken if the ConvertTo-SecureString function fails while using the Backup-CARoleService with the -Password parameter.
Таблица SEQ таблица, \ * Арабская 18. распространенные ошибки Table SEQ Table \* ARABIC 18: Common Errors
Действие Action | Ошибка Error | Комментировать Comment |
---|---|---|
Restore-Каролесервице К:\адксбаккуп Restore-CARoleService C:\ADCSBackup | Restore-Каролесервице: процесс не может получить доступ к файлу, так как он используется другим процессом. Restore-CARoleService : The process cannot access the file because it is being used by another process. (Exception from HRESULT: (Exception from HRESULT: 0x80070020 0x80070020) | Перед запуском командлета Restore-Каролесервице завершите работу службы служб сертификатов Active Directory Stop the Active Directory Certificate Services service prior to running the Restore-CARoleService cmdlet |
Restore-Каролесервице К:\адксбаккуп Restore-CARoleService C:\ADCSBackup | Restore-Каролесервице: Каталог не пуст. Restore-CARoleService : The directory is not empty. (Исключение из HRESULT: 0x80070091) (Exception from HRESULT: 0x80070091) | Используйте параметр-Force для перезаписи существующих ключей Use the -Force parameter to overwrite preexisting keys |
Backup-Каролесервице К:\адксбаккуп-пароль (чтение-хост-запрос «пароль:»-AsSecureString)-Датабасеонли Backup-CARoleService C:\ADCSBackup -Password (Read-Host -Prompt «Password:» -AsSecureString) -DatabaseOnly | Backup-Каролесервице: не удается разрешить набор параметров с использованием указанных именованных параметров. Backup-CARoleService : Parameter set cannot be resolved using the specified named parameters. | Параметр-Password используется только для защиты паролем закрытых ключей и, следовательно, является недопустимым, если архивация не выполняется The -Password parameter is only used to password protect private keys and is therefore invalid when you are not backing them up |
Restore-Каролесервице C:\ADCSBack15-Password (чтение-хост-запрос «пароль:»-AsSecureString)-Датабасеонли Restore-CARoleService C:\ADCSBack15 -Password (Read-Host -Prompt «Password:» -AsSecureString) -DatabaseOnly | Restore-Каролесервице: не удается разрешить набор параметров с помощью указанных именованных параметров. Restore-CARoleService : Parameter set cannot be resolved using the specified named parameters. | Параметр-Password используется только для защиты паролем закрытых ключей и поэтому является недопустимым, если вы не восстанавливаете их. The -Password parameter is only used to password protect private keys and is therefore invalid when you are not restoring them |
Restore-Каролесервице C:\ADCSBack14-Password (чтение-хост-запрос «пароль:»-AsSecureString) Restore-CARoleService C:\ADCSBack14 -Password (Read-Host -Prompt «Password:» -AsSecureString) | Restore-Каролесервице: системе не удается найти указанный файл. Restore-CARoleService : The system cannot find the file specified. (Исключение из HRESULT: 0x80070002) (Exception from HRESULT: 0x80070002) | Указанный путь не содержит допустимой резервной копии базы данных. The path specified does not contain a valid database backup. Возможно, путь является недопустимым или резервная копия была сделана с параметром-Кэйсонли? Perhaps the path is invalid or the backup was taken with the -KeysOnly option? |
Дополнительные ресурсы Additional Resources
Попробуйте сделать это: Создайте резервную копию центра сертификации в лаборатории с помощью Windows PowerShell Try This: Backup the CA in your lab using Windows PowerShell
Используйте команды на этом занятии, чтобы создать резервную копию базы данных ЦС и закрытого ключа, защищенных паролем. Use the commands in this lesson to backup the CA database and private key secured with a password.
Подождите, пока не будет восстановлен ЦС. Hold off on the restore of the CA at this time.