Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 9995

PowerShell • Re: change repo by Power Shell

$
0
0
Hi Ahmed.albatoosh,

Sure, the following code is pseudo-code, but should be all you need:

cmdlets:

Get-VBRUnstructuredBackupJob
Get-VBRUnstructuredBackup
Detach-VBRBackup
Set-VBRNasBackupJob

Basic workflow would be:

Code:

$uJob = Get-VBRUnstructuredBackupJob #Fetches all Unstructured backup jobs, probably you will want to filter this somehow$newRepo = Get-VBRBackupRepository -Name "Name of new Repository"Foreach($u in $uJob){$uBackup = Get-VBRUnstructuredBackup | Where-Object {$_.JobId -eq $u.id}Detach-VBRBackup -Backup $uBackupSet-VBRNasBackupJob -Job $u -ShortTermBackupRepository $newRepoDelete-Variable ubackup}
Note this is very basic structure of the code and will point all jobs to the repo you assign to variable $newRepo -- if you need to point to different repositories depending on the job, you will need to write your own logic to determine that.

Statistics: Posted by david.domask — Aug 25, 2025 8:12 am



Viewing all articles
Browse latest Browse all 9995

Latest Images

Trending Articles



Latest Images