-
- Enthusiast
- Posts: 77
- Liked: 12 times
- Joined: Jul 17, 2019 10:06 pm
- Contact:
Enable Insider Protection for all tenants
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!
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!
-
- Veeam Software
- Posts: 37
- Liked: 19 times
- Joined: Mar 01, 2017 2:10 pm
- Full Name: Mike Zollmann
- Contact:
Re: Enable Insider Protection for all tenants
Please post the Case ID so we can review.
Mike Zollmann
Manager, System Engineering - VCSP
Manager, System Engineering - VCSP
-
- Veeam Vanguard
- Posts: 282
- Liked: 113 times
- Joined: Apr 20, 2017 4:19 pm
- Full Name: Joe Houghes
- Location: Castle Rock, CO
- Contact:
Re: Enable Insider Protection for all tenants
It's because you are not giving it a CloudTenant object as required.
If you have the tenant name, you can do this:
This is similar to all of the examples listed at the bottom of the doc for the Set-VBRCloudTenant cmdlet.
If you have the tenant name, you can do this:
Code: Select all
$tenant = Get-VBRCloudTenant -Name 'tenantname'
Set-VBRCloudTenant -CloudTenant $tenant -EnableBackupProtection: $True
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
-
- Enthusiast
- Posts: 77
- Liked: 12 times
- Joined: Jul 17, 2019 10:06 pm
- Contact:
Re: Enable Insider Protection for all tenants
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.
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.
-
- Veeam Vanguard
- Posts: 282
- Liked: 113 times
- Joined: Apr 20, 2017 4:19 pm
- Full Name: Joe Houghes
- Location: Castle Rock, CO
- Contact:
Re: Enable Insider Protection for all tenants
You just need to get all tenants and then wrap that same code in a foreach loop.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
-
- Product Manager
- Posts: 9848
- Liked: 2609 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: Enable Insider Protection for all tenants
I have found somewhere this script last Juli.
It’s possible, that is from the veeam powershell github site:
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
Product Management Analyst @ Veeam Software
-
- Enthusiast
- Posts: 77
- Liked: 12 times
- Joined: Jul 17, 2019 10:06 pm
- Contact:
Re: Enable Insider Protection for all tenants
TYVM @mildur that worked perfectly.
-
- Enthusiast
- Posts: 77
- Liked: 12 times
- Joined: Jul 17, 2019 10:06 pm
- Contact:
Re: Enable Insider Protection for all tenants
So since this is now a module instead of of a snapin. May I get some help again please ?
Updated Add-PSSnapin VeeamPSSnapIn to be "Import-Module Veeam.Backup.PowerShell" in the above script:
But I now get the following warning:
Is there any way to suppress the warning? Thank you for any help in advanced!
Updated Add-PSSnapin VeeamPSSnapIn to be "Import-Module Veeam.Backup.PowerShell" in the above script:
Code: Select all
# Enables Insider Protection and configures a default value.
# Does not reduce the period manually set on any given tenant.
$DefaultNumberOfProtectedDays = 7
Import-Module Veeam.Backup.PowerShell
# 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
Code: Select all
WARNING: The names of some imported commands from the module 'Veeam.Backup.PowerShell' include unapproved verbs that might make them less discoverable. To find the commands with
unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
-
- Product Manager
- Posts: 9848
- Liked: 2609 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: Enable Insider Protection for all tenants
Have a look here:
https://www.vblog.nl/veeam-v11-powershe ... -warnings/
I can‘t test it at the moment. But it looks like a solution to me for the problem:
https://www.vblog.nl/veeam-v11-powershe ... -warnings/
I can‘t test it at the moment. But it looks like a solution to me for the problem:
This is because the Veeam Powershell module is not in the default paths so you can add some lines to you scripts to fix this issue:
$VeeamModulePath = “C:\Program Files\Veeam\Backup and Replication\Console”
$env:PSModulePath = $env:PSModulePath + “$([System.IO.Path]::PathSeparator)$VeeamModulePath”
Import-Module -DisableNameChecking Veeam.Backup.PowerShell
Product Management Analyst @ Veeam Software
-
- Veeam Software
- Posts: 2011
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Enable Insider Protection for all tenants
This warning has nothing to do with the module path not being in $env:PSModulePath variable. It appears whenever a module has verbs not presented in this list and thus considered unapproved. But that's just an indication, the complete module is still imported. To suppress this warning, import ps module with the parameter below:
For more information see this MS article.
Thanks!
Code: Select all
Import-Module Veeam.Backup.Powershell -DisableNameChecking
Thanks!
-
- Product Manager
- Posts: 9848
- Liked: 2609 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: Enable Insider Protection for all tenants
Thanks Oleg
Product Management Analyst @ Veeam Software
-
- Enthusiast
- Posts: 77
- Liked: 12 times
- Joined: Jul 17, 2019 10:06 pm
- Contact:
Re: Enable Insider Protection for all tenants
That fixed it. Tyvm everyone!
Who is online
Users browsing this forum: No registered users and 12 guests