VeeamON 2024 - Use Code "COMMUNITY10" for 10% Off!
It was brought to my attention recently that some of the cmdlets have changed in v12.x that may have broken one or more of the above scripts. I’ve rewritten the one that was pointed out (Veeam Agent Jobs) and tested to make sure it works. I can’t vouch for the others, but will try to get around to updating them all (if needed) and posting the updates here. Just be sure if you’re on 12.x or newer that you do thorough checks to confirm it works in a safe environment before attempting to run anything in production. Updated (and improved) script for toggling Health Checks for Veeam Agent jobs.do { #Ask user for input to determine which actions to perform. $userInput = Read-Host "Enter the number that corresponds to the action you would like to perform, then press 'ENTER': (NOTE: The 'HealthCheckOptions' parameter is not available for backup policies that are applied to Linux computers.) 1. DISABLE health checks for ALL Veeam Agent for Windows jobs. 2. ENABLE heath checks for
Hi folks. This command does not seem to work with 12.0/12.1 and PostgreSQL. The .NET call returns the following: Exception calling "GetEnterpriseServerInfo" with "0" argument(s): "Object reference not set to an instance of an object."At line:1 char:1+ [Veeam.Backup.Core.SBackupOptions]::GetEnterpriseServerInfo() | Selec ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : NullReferenceException Any clues? Heya! Yeah, in 12.x the command no longer works unless you run any other Veeam cmdlet prior in order to fully load up the modules (Import-Module doesn’t work, either). Here’s the updated way that I use it:Get-VBRServer | Out-Null[Veeam.Backup.Core.SBackupOptions]::GetEnterpriseServerInfo() | Format-List
Sorry, I’m a little late to the party, but I have a method in PowerShell that doesn’t require calling Invoke-SqlCmd cmdlet as it’s not installed by default in Windows Server (unless you also have SQL installed on the server or have installed manually). Import-Module Veeam.Backup.PowerShell -WarningAction SilentlyContinue[Veeam.Backup.Core.SBackupOptions]::GetEnterpriseServerInfo() | Select IsConnected, ServerName, Url | Format-List
O M G! THIS IS AWESOME!!! @MicoolPaul, are you secretly working for Universal Pictures or 20th Century studios? Definitely not! Haha just trying to make a few people smile on the internet!
Thanks for the shoutout @Kseniya and @Rick Vanover! Close call there on nearly revealing the superhero’s true identity 😂 That was hilarious. I’m happy that you found the script interesting and useful enough to even be mentioned here 🙂
Thanks, it’s interesting :). Do not hesitate to publy your scripts who can be share on github. https://github.com/VeeamHub/powershell I actually have submitted one which got added :) https://github.com/VeeamHub/powershell/tree/master/BR-Multi-FLR I figured the VeeamHub repository was more for fleshed-out scripts that are wrapped up nice and neat into a function, but maybe I should include even the simple ones like this since I’m sure it’d be more likely to be found by someone searching for it.
Edit (6/25/21): Made a slight edit to the Restore-VESQLDatabase command towards the end to comment out the -GuestCredentials $SQLCreds by default since the $SQLCreds variable was commented out by default as well. Also adjusted the comments to provide additional clarity.Thanks for the kind words. I’m a novice at PowerShell scripting, so I’m doing most of this for my own benefit in learning, so I always appreciate the feedback and ways to improve it. I hope someone finds use out of it! :)
When you work for Veeam and you didn’t even realize this was an added feature🤦♂️ Thanks for sharing! Goes to show just how many little things there are in Veeam to discover every day 😁
Thank you, il will be useful for some use cases! I have a question correlated with FLR on linux hosts, do you know how to change the system target? Sometimes you can have the use case to restore a file from a system directly to another? Veeam asks me this only when the vm was re generate by ansible, the name doesn’t change but the VM ID yes. I should actually edit my script to distinguish the fact that I only tested this for Windows servers; I completely overlooked Linux ::facepalm:: It hadn’t even crossed my mind. I’ll actually work on that as soon as I get time.As for your question.. are you asking if it’s possible to restore a file from one server to a location on a separate server? If that is what you were referring to then yes, this script supports UNC path as a target to copy files to, so as long as you can reach the target via UNC then the script will support it (at least I can confirm that’s the case for Windows OS’, specifically).
Just from the way the script is setup one may assume that the $tag variable would be the VMware tag applied to VMs that have AAiP enabled in their backups, but isn’t this line of code checking whether or not the VMware does not match the $tag variable?$vms = Get-VM |where {$_.Tag -ne $tag}Shouldn’t this be:$vms = Get-VM |where {$_.Tag -eq $tag} Apologies if I’m mistaken. I haven’t yet played around with this script (need to actually start making use of VMware tags, hah), but I was just skimming through and that caught my eye and intuitively I feel like it should be checking to see if it does match.Regardless, nice script! Thanks for sharing!
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.