PowerShell script exchange
Post Reply
jellekamma
Influencer
Posts: 13
Liked: never
Joined: Jan 07, 2019 11:22 am
Full Name: Jelle Kamma
Contact:

Oneliner to remove VM from every backup job

Post by jellekamma »

Hi there,


we are backing up our VM's with tags from two sites. So every VM that I backup can be in a few different backups jobs.
I am looking for the powershell script which allows me to remove virtualmachine$ from every backup source.
Currently I have to specify in which job the VM resides. I dont want to do that. Each VM is in only one job so I would like to automate this task with our VM decommission script.

Can someone help me realise this?
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Oneliner to remove VM from every backup job

Post by david.domask »

Heya @jellekamma,

If you're on v12, use Global Exclusions:

https://helpcenter.veeam.com/docs/backu ... on&ver=120

You don't need to set it for each job :)

Doing it per job isn't really a one-liner thing, and since you're using Tags, I'm not sure it's possible since you need to do it a little funny as I remember, and it's slightly more funny with Tags in the mix, since you can't transverse hierarchy objects like tags with Powershell.

I can likely figure it out for you later if necessary (traveling today), but see if Global Exclusions solve your issue for you.
David Domask | Product Management: Principal Analyst
jellekamma
Influencer
Posts: 13
Liked: never
Joined: Jan 07, 2019 11:22 am
Full Name: Jelle Kamma
Contact:

Re: Oneliner to remove VM from every backup job

Post by jellekamma »

Hi, thanks for your answer, I dont need to stop the backup with excluding the VM, I really need it to be deleted due to compliance issues.
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Oneliner to remove VM from every backup job

Post by david.domask »

Hi @jellekamma,

Just to make sure I get it right, your goals are:

1. Ensure that specific VMs are not backed up due to compliance reasons
2. Delete all existing backups of said VM for compliance reasons

Am I correct?

Please confirm, as there are ways to do this, but it will be a bit of code (not going to be a one liner likely if you need to be thorough, which I imagine compliance reasons requires).
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests