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 : 12/22/2022-05:42
BackupTime : 12/21/2022 9:42:24 PM
BackupTarget : \\10.0.0.102\Share01
RecoverableItems : Volumes, SystemState, Applications, Files, BareMetalRecovery
Volume : {EFI System Partition, Local disk (C:), (Disk does not have drive letter)
(\\?\Volume{1fc33f07-cb61-4747-b878-7e8337269bb1}\)}
Application : {Registry}
VssBackupOption : VssCopyBackup
SnapshotId : 00000000-0000-0000-0000-000000000000
BackupSetId : 1bf82d71-92e6-420b-ac5b-255402010835
# 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 : Preparing to recover files.
Completed.
PS C:\Users\Administrator> ls C:\Users\Administrator\Desktop\recovery
Directory: C:\Users\Administrator\Desktop\recovery
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 12/20/2022 8:10 PM Administrator
|