PowerShell script exchange
Post Reply
EdgarRicharte
Service Provider
Posts: 60
Liked: 10 times
Joined: Jul 17, 2019 10:06 pm
Contact:

Enable Insider Protection for all tenants

Post by EdgarRicharte »

Hello,

Anyone have a powershell script to enable insider protection for all tenants. I tried:
SetVBRCloudTenant -BackupProtectionEnabled: $True

But it would ask for a cloud tenant. I type in the tenant name. But would give me an error. Contacted veeam support but they advised it was out of their scope unfortunately. I could've sworn I saw a similar thread on these forums a while ago. But am unable to find it. Ty for any help!

Rather do it through powershell. Instead of going through each company and manually enabling.thanks again!

mzollmann
Veeam Software
Posts: 24
Liked: 11 times
Joined: Mar 01, 2017 2:10 pm
Full Name: Mike Zollmann
Contact:

Re: Enable Insider Protection for all tenants

Post by mzollmann »

Please post the Case ID so we can review.
Mike Zollmann
Sr. Systems Engineer - VCSP

jhoughes
Veeam Software
Posts: 228
Liked: 78 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Enable Insider Protection for all tenants

Post by jhoughes »

It's because you are not giving it a CloudTenant object as required.

If you have the tenant name, you can do this:

Code: Select all

$tenant = Get-VBRCloudTenant -Name 'tenantname'
Set-VBRCloudTenant -CloudTenant $tenant -EnableBackupProtection: $True
This is similar to all of the examples listed at the bottom of the doc for the Set-VBRCloudTenant cmdlet.
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | VMUG US South Regional Champion | VMware vExpert | Cisco Champion

EdgarRicharte
Service Provider
Posts: 60
Liked: 10 times
Joined: Jul 17, 2019 10:06 pm
Contact:

Re: Enable Insider Protection for all tenants

Post by EdgarRicharte »

Case #04478442

I know how to do it individually. I was hoping someone could paste a script that I could use to enable it for all tenants en masse. I've done it before. But it was over a year ago. And I can no longer find the script.

jhoughes
Veeam Software
Posts: 228
Liked: 78 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Enable Insider Protection for all tenants

Post by jhoughes »

You just need to get all tenants and then wrap that same code in a foreach loop.
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | VMUG US South Regional Champion | VMware vExpert | Cisco Champion

Mildur
Service Provider
Posts: 415
Liked: 178 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian Kessler
Contact:

Re: Enable Insider Protection for all tenants

Post by Mildur » 2 people like this post

I have found somewhere this script last Juli.
It’s possible, that is from the veeam powershell github site:

Code: Select all

# Enables Insider Protection and configures a default value.
# Does not reduce the period manually set on any given tenant.

$DefaultNumberOfProtectedDays = 7

Add-PSSnapin VeeamPSSnapIn

# Finds all tenants where Insider Protection is disabled, and enables it, with the number of days defined above.
Get-VBRCloudTenant | Where-Object -Property BackupProtectionEnabled -EQ $false | Set-VBRCloudTenant -EnableBackupProtection: $true -BackupProtectionPeriod $DefaultNumberOfProtectedDays 

# Finds all tenants where Insider Protection's protection period is less than the default value, and raises it to the default.
Get-VBRCloudTenant | Where-Object -Property BackupProtectionPeriod -LT $DefaultNumberOfProtectedDays | Set-VBRCloudTenant -BackupProtectionPeriod $DefaultNumberOfProtectedDays

EdgarRicharte
Service Provider
Posts: 60
Liked: 10 times
Joined: Jul 17, 2019 10:06 pm
Contact:

Re: Enable Insider Protection for all tenants

Post by EdgarRicharte »

TYVM @mildur that worked perfectly.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests