PowerShell script exchange
Post Reply
mrholm
Expert
Posts: 170
Liked: 15 times
Joined: Apr 20, 2018 8:12 am
Full Name: Mats Holm
Contact:

Script for export a backup from job and set 1 year retention

Post by mrholm »

Hi all
Am about to do a lot of exports from a backup job and set a retention on it. The reason for this is that the VMs are to be decommisioned.
We do this manually today and like to see if anyone have cretaed a script for this already.

We always use the same specific backup job (#decom_VM) so we have a full backup to then export so it is only one point for the VM in the job
We always use 1 year retention for delete the file automaticlaly.
Our input from other part of the decom script is the VM name so I'd like to be able to point to the last backup of the specific session of (#decom_VM) and point to the VM name and set 1 year for deleteion.

Anyone done this?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script for export a backup from job and set 1 year retention

Post by veremin » 1 person likes this post

Have you thought about scripting Export Backup functionality? It allows you to extract a selected restore point to a standalone full backup and set a retention period for it.

If it something that answers your requirements, take a look at this cmdlet.

Thanks!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 23 guests