Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# set backup location object
# example follows is for the case backups exist on shared folder
# for the case backups exist on local drive ⇒ -VolumePath (drive letter)
PS C:\Users\Administrator> $BackupLocation = New-WBBackupTarget -NetworkPath "\\10.0.0.102\Share01" `
-Credential (New-Object PSCredential("Serverworld", (ConvertTo-SecureString -AsPlainText "P@ssw0rd01" -Force)))
# confirm backups
PS C:\Users\Administrator> Get-WBBackupSet -BackupTarget $BackupLocation
VersionId : 09/18/2020-22:16
BackupTime : 9/18/2020 3:16:58 PM
BackupTarget : \\10.0.0.102\Share01
RecoverableItems : Volumes, SystemState, Applications, Files, BareMetalRecovery
Volume : {EFI System Partition, Recovery, Local disk (C:), New Volume (D:)}
Application : {Registry}
VssBackupOption : VssCopyBackup
SnapshotId : 00000000-0000-0000-0000-000000000000
BackupSetId : 3f3d142f-644e-45b3-b0ea-7d5d6c6b4517
# set backupset object
PS C:\Users\Administrator> $Backups = Get-WBBackupSet -BackupTarget $BackupLocation
# run recovery
# -SourcePath (recovering source files/folders)
# -Recursive ⇒ if a folder specified for SourcePath, recover all files recursively
# -TargetPath (target Path for saving recovering files)
PS C:\Users\Administrator> Start-WBFileRecovery -BackupSet $Backups -SourcePath "C:\Users\Administrator" -Recursive -TargetPath "C:\Users\Administrator\Desktop\recovery"
Warning
Start recovery of files from C:\Users\Administrator to C:\Users\Administrator\Desktop\recovery ?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
Recovering files from C:\Users\Administrator :
Recovering files from C:\Users\Administrator :
Recovering files from C:\Users\Administrator : 35% of files recovered.
Recovering files from C:\Users\Administrator : 87% of files recovered.
Completed.
PS C:\Users\Administrator> ls C:\Users\Administrator\Desktop\recovery
Directory: C:\Users\Administrator\Desktop\recovery
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 9/17/2020 9:41 PM Administrator
|