Download featured YARA rules, browse code samples or contribute your own scripts
Recently active
One thing I’ve found as a Veeam customer is you often have to restart the VSS services on your SQL and other VSS aware servers. Here’s a script I wrote to do just that.# Name: Restart-VSS.ps1# Description: Restarts list of services in an array on VMs with a given vSphere tag. Helpful for Veeam B&R processing# For more info on Veeam VSS services that may cause failure see https://www.veeam.com/kb2041Import-Module VMware.PowerCLI$vcenter = "vcenter.domain.com"$services = @("SQLWriter","VSS")$tag = "myAwesomeTag"Connect-VIServer $vcenter$vms = Get-VM |where {$_.Tag -ne $tag}ForEach ($vm in $vms){ ForEach ($service in $services){ If (Get-Service -ComputerName $vm -Name $service -ErrorAction SilentlyContinue) { Write-Host $service "on computer" $vm "restarting now." Restart-Service -InputObject $(Get-Service -Computer $vm -Name $service); } }}
Hi, all I made a simple script that will allow you to run the backup validator and receive a report. echocd C:\Program Files\Veeam\Backup and Replication\BackupVeeam.Backup.Validator.exe /backup:"BackupName" /report:"C:\VeeamReports"rem May have to specify name(s) of VMs being backed up in jobrem If there are multiple backup jobs, you must create a new line for each job --> Veeam.Backup.Validator.exe /backup:"BackupName" /report:"C:\VeeamReports"
The PowerShell script to automate the upgrade for Veeam Backup & Replication & Enterprise Manager to v11 is now available on VeeamHub! Here’s a blog post with more detailed information: https://www.arsano.ninja/2021/03/09/veeam-unattended-upgrade-v11/ If you're a VCSP, the script can also be used for Cloud Connect environment upgrades.
<#.Synopsis Generates report of all repositories known to a given Veeam Service Provider Console Server. Uses the new v3 API so your milage may vary..Notes Version: 1.0 Author: Jim Jones Modified Date: 8/21/2020 If running for the first time a new computer You will need to run to store the credentials $credpath='c:\creds\myadmincred.xml' GET-CREDENTIAL –Credential (Get-Credential) | EXPORT-CLIXML $credpath.EXAMPLE .\VACStorageReport.ps1 -vacServer 'vac.mydomain.com' -authPath 'c:\creds\myadmincred.xml'#>[CmdletBinding()]Param ( [string]$vacserver = "vac.mydomain.com", [string]$authpath = "c:\creds\myadmincred.xml")#Email Variables$date = Get-Date$sgToken = "SendGridToken"$fromAddress = "myvac@mydomain.com"$fromName = "US VAC"$toName = "NetOps"$toAddress = "me@me.com"$emailBody = "See attached VSPC Repository Usage Report for $date"$emailSubject = "VSPC Repository Usage Report for $date"$Credentials = IMPORT-CLIXML -path $a
Not too long ago I had a customer who only had a Standard license which meant he didn’t have access to SureBackup, but had a need to validate a highly critical SQL database’s backups on a near daily basis. I figured it wouldn’t be too hard to write up a PS script that’d take some basic information about the source job name and database and where it needed to be restored and quickly sort by most recent and selecting it and kicking off the restore. That way he could just fire up the script when necessary. He ended up setting up a scheduled task where each day his DBAs would have the previous day’s backup restored next to the production database and they could do whatever verifications they needed. Easy peasy!Note: Tested and working in v10 & v11 (Should work just fine in v9.x as well, but not tested)<### Un-comment to enable debug output when troubleshooting script ###>#$DebugPreference = "Continue"<### Included for backward compatibility for servers still running pre-v10. #
Here’s a sample PowerShell script to enforce Restore Point configuration for both VMware Backup Jobs & vCloud Backup Jobs. The script retrieves the job’s current retention setting (Restore Points), compares it against the standard defined in a CSV file, and adjusts the configuration where needed. For more detailed information, please follow the VeeamHub link:https://github.com/VeeamHub/powershell/tree/master/BR-EnforceJobRetention
I’ve been searching and trying different commands to set the flag to “enable backup file encryption” within the VBR “Configuration Backup Settings”.While I can see how to create the password with the API with the Add-VRBEncryptionKey shown below, I don’t see a command to set the flag above. Any help would be greatly appreciated...
We are not getting restore job Id while running the below PowerShell command in Veeam 11, but for versions below 11, we are getting the restore job id.I checked the Veeam11 commands document but couldn’t find anything helpful regarding VM restore job id.Let us know if there is any particular command to fetch the job id. Running command using Veeam11:$latest_backup_copy = Get-VBRBackup -Name 'backup_job_0'| Get-VBRRestorePoint -Name 'oracle_smallest' | Sort-Object -Property CreationTime -Descending | Select -First 1 ;; Start-VBRRestoreVM -RestorePoint $latest_backup_copy -ToOriginalLocation -StoragePolicyAction Default -PowerUp:$True -RunAsync Restore Type VM Name State Start Time End Time Description------------ ------- ----- ---------- -------- -----------RestoreVm oracle_smallest Starting 5/28/2021 12:17:24 PM 1/1/1900 12:00:00 AM Running
Hello everyone, today I bring you one more step on how to correctly secure our instance of Veeam Backup for AWS v2.To do this we will rely on Let’s Encrypt, the famous open-source project that allows us to generate free SSL certificates.NOTE: This process is not officially supported by Veeam, and any consequence of following the steps incorrectly, or any incidence derived from these steps will leave us without support. We will have to deploy the appliance again, keep that in mind!Where shall I run this Script?My recommendation will be to run it from a Linux VM, Container, or similar that you have already on your on-prem, or in the Cloud. As a last alternative, not supported of course, is to follow these steps inside the Veeam Backup for AWS appliance itself.Installation of system requirementsTo make it all work we’re going to need a couple of packages to do all this automatically:jq The necessary Let’s Encrypt packagesTo install jq, we will launch the following command:sudo apt-get ins
First time sharing, so feedback is much appreciated, but please excuse my code if it’s not up to par with those who have a lot more experience with Powershell than I. I recently had a client who -- for legal purposes -- needed to restore the same folder from two month’s worth of backups. Running 61 File Level Restores in the GUI seemed like a nightmare, so he opened a case asking if there was an easier way. Unfortunately, through the GUI there’s really not an easier way, but this sounded like a perfect scenario for leveraging some Veeam PowerShell cmdlets. I soon discovered that the FLR cmdlets don’t have functionality that supports a ‘Copy To’ feature like you’d get in the GUI, so I had to leverage what Veeam cmdlets we do have and then add in some good old basic PowerShell commands to then pull the data from the mount point (C:\VeeamFLR\ by default) and move it to the target, then loop through n-number of times based on the user input.Here’s what I came up with. I’m still working on
This is a simple oneliner for the MSPs out there if you are needing to check if Ransomguard is enabled for your VCC tenants this will output it on the screen for you from Powershell - Get-VBRCloudTenant | sort-object | FT Name, BackupProtectionEnabled, BackupProtectionPeriod You can also output this to a file that could be emailed as well.
VBR integration for storage systems supports several useful features that optimize backup performance. Unfortunately for those systems built on the Universal Storage API (USAPI) some of those features are not yet available. One specific feature that is missing is the ability to orchestrate array-based snapshots on a secondary storage array.I’ve written a PowerShell script to be used as a post-job VBR script along with snapshot-only jobs for Pure Storage FlashArray which will replicate Veeam created array snapshots to a secondary FlashArray. It will also ensure that those snapshots are visible in the VBR console and available for recovery tasks including Instant VM recovery, Guest Files recovery, and Application Item Recovery. Download Invoke-PfaSendSnapAfterVBRJob.ps1 from GitHub. Detailed setup instructions. This script has been designed to work both with VBR v10 VeeamPSSnapIn as well as the brand new VBR v11 PowerShell Toolkit.
Here’s a script I wrote to create Azure AD applications for VBO usage aside from creating the app from within VBO itself.I experienced that this is not always easy to do (Global Admin using VBO to create an app, or having the Global Admin read the documentation and create the application with the right permissions, etc… on his own), so I hope my script can help here. Check out my blog article on it at VBO365: Create Azure AD applications automatically with least priviliges – Z8NAnd the script itself is available on Github: veeam/vbo-create-azure-ad-app.ps1 at master · StefanZi/veeam (github.com)
Backup job: mwc-appsvr-midtier_2020-11-17T095355 (Full) Error 1 of 1 VMs processed 17 November 2020 09:53:55 AM Success 0 Start time 09:53:55 AM Total size 0 B Backup size 0 B Processing mwc-appsvr-midtier Error: Access is denied. Could not perform threshold check for backup location "\\10.0.0.12\Backup\VirtualMachines\Autobackups" due to space info retrievement fail! Warning 0 End time 09:54:35 AM Data read 0 B Dedupe 1.0x Error 1 Duration 0:00:39 Transferred 0 B Compression 1.0x Details Name
Not to be a negative nelly, but don’t we already have github.com/veeamhub as a repository that is purpose built for this type of content, managed by people who know code? Can we not push community script additions there rather than turning them into effectively forum posts?
Hey, Don’t know about you guys but I feel Veeam are missing what could be a very successful trick here with their SureBackup and Pre/Post Processing script functionalities. I know we have VeeamHub for some PowerShell scripts but I think to really push the value of Veeam integrating into our customers’ enterprise application stacks it would be great to have a more direct interface of getting scripts into Veeam. I’ve seen plenty of systems integrating “stores” or other web fronts to enable simple access. It’d be great to see ways of integrating with systems that have been seen as “traditionally” unfriendly to snapshoting and also to validate more complex workloads.I’m sure there are plenty of great scripts out there that just aren’t being shared due to lack of visibility of the existing platforms but driving it into the client would really improve feature take up. That’s my opinion anyway, how do you all feel about this? Wouldn’t you like vendors to be able to offer a one click “it just
#region: Add Veeam PSSnapin and ConnectAdd-PSSnapin VeeamPSSnapin$VeeamCred = Get-Credential -Message "Veeam Credential"Connect-VBRServer -Server "192.168.3.100" -Credential $VeeamCredFind-VBRViEntity#endregion#region: VMware Module and vCenter ConnectionGet-Module -ListAvailable -Name VMware* | Import-ModuleSet-PowerCLIConfiguration -DefaultVIServerMode Single -InvalidCertificateAction Ignore -Scope Session -Confirm:$false$vCenterCred = Get-Credential -Message "vCenter Credential"Connect-VIServer -Server "192.168.3.101" -Credential $vCenterCred#endregion#region: List Objects in Backup Jobs$VBRJobs = (Get-VBRJob).where({$_.JobType -eq "Backup" -and $_.Name -like "*Location*"})## List Backup Jobs that match the filter$VBRJobs | Select Name, JobType, SourceType | ft$VBRJobToLocationA = Get-VBRJob -Name "Backup to LocationA"## list Objects in Job$VBRJobToLocationA.GetObjectsInJob().GetObject() | Select ViType, Name, ObjectId | ft#endregion#region: Get Veeam Tag Details## Veeam Inventory(F
#Requires -Version 7#Requires -Modules PSSendGrid<#.Synopsis Generates report of relevant data on all customers known to a given Veeam Service Provider Console Server. Uses the new v3 API so your milage may vary..Notes Version: 0.6 Author: Jim Jones Modified Date: 8/21/2020 If running for the first time a new computer You will need to run to store the credentials $credpath='c:\creds\myadmincred.xml' GET-CREDENTIAL –Credential (Get-Credential) | EXPORT-CLIXML $credpath.EXAMPLE .\vspcCompanyReport.ps1 -vacServer 'vac.mydomain.com' -authPath 'c:\creds\myadmincred.xml'#>[CmdletBinding()]Param ( [string]$vacServer = "vac.mydomain.com", [string]$authPath = 'c:\creds\myadmincred.xml')#Email Variables$date = Get-Date$sgToken = "SendGridToken"$fromAddress = "myvac@mydomain.com"$fromName = "US VAC"$toName = "NetOps"$toAddress = "me@me.com"$emailBody = "See attached Company Backup Resource Report for $date"$Credentials = IMPORT-CLIXML
Veeam ONE is a complete monitoring system for VMware, Hyper-V, Veeam and even at the application level being able to monitor VM services and processes running Microsoft Windows, without the need to install any agent, and all through API.As @Rick Vanover usually says, Veeam ONE will surely tell us more than one thing about our environment that we don't know, and Rick is right, with several hundred metrics that Veeam ONE collects, added to the several dozen reports that are included by default, Veeam ONE is that co-worker that we all would like to have in our IT team.Veeam ONE allows you to create notifications for each predetermined alarm or alarms that we create ourselves. While it is true that email notifications are the most basic and the ones we probably configure by default, sadly, it is true that email has become a tool overloaded with daily content, and most likely if a critical alarm falls in a folder or inbox along with 150 other emails, it will not pay the attention it require
Veeam is not responsible nor can be held accountable for the accuracy and usability for code samples published in the Script Library.Scripts are licensed to you by the sample's author and fall under your responsibility.
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.