PowerShell script exchange
Post Reply
manuel.aigner
Influencer
Posts: 18
Liked: 1 time
Joined: Sep 25, 2017 8:25 am
Full Name: Manuel Aigner
Contact:

[FEATURE REQUEST] Assign SQL log shipping server to object

Post by manuel.aigner » Feb 15, 2018 3:39 pm

Hi there,

I can't find any cmdlet which is able to assign designated log shipping servers to a job object for transaction log backup.
It's only possible to enable or disable auto selection. If it's disabled, no log shipping server is selected -> therefore useless... this config can't work.

It's necessary in our environment to declare this servers because only a few veeam servers are (firewall) permitted to do this.

ATM there are two options for us:

#1 Let auto select enabled.
Log backup jobs will work, but takes longer then necessary because many connection trials will fail (Firewall) until the right veeam server has found.

#2 Configure it manually via GUI.
URGH... I've automated everything. It's not nice to do only this thing manually (big potential for human mistakes).

tsightler
VP, Product Management
Posts: 5497
Liked: 2313 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: [FEATURE REQUEST] Assign SQL log shipping server to obje

Post by tsightler » Feb 15, 2018 9:37 pm 1 person likes this post

Here's a workaround that I've used with a few other cases. It makes one call directly to a .NET function, so it's unsupported, but it seems to work just fine as long as you pass it valid data. If you somehow pass the call with the wrong host ID it can leave you in a state where the GUI will give an error about a missing ID and not open the VSS dialog (yes, I had this happen with a customer that didn't fully understand how to use it and passed the proxy ID instead of the Host ID). This is easily fixed by removing the bad entry from the OijProxies table. Basically, it's only one unsupported call to a very simple function, so I consider this fairly safe if you validate the information you are submitting is accurate, i.e. the correct object-in-job ID and the correct host ID for the log shipping server. Also, you can repeat the call to add more log shipping servers.

Code: Select all

# Get the Job
$Job = Get-VBRJob -Name "<Backup_Job_Name>"

# Get the Job object to set VSS Options
$SqlOij = Get-VBRJobObject -Job $Job -Name "<Job_Object_Name>"

# Get the Server object for the log server
$LogServer = Get-VBRServer -Type Windows -Name "<Log_Server_Name>"

# Set the SQL VSS for manual log shipping server
$SqlOij.VssOptions.SqlBackupOptions.ProxyAutoSelect = $false

# Add a server as a log shipping server for this object
[Veeam.Backup.Core.COijProxy]::Create($SqlOij.Id, $LogServer.Id, 0)

# Save the VSS Options
Set-VBRJobObjectVssOptions -Object $SqlOij -Options $SqlOij.VssOptions

manuel.aigner
Influencer
Posts: 18
Liked: 1 time
Joined: Sep 25, 2017 8:25 am
Full Name: Manuel Aigner
Contact:

Re: [FEATURE REQUEST] Assign SQL log shipping server to obje

Post by manuel.aigner » Feb 16, 2018 9:38 am

Hi Tom,

many thanks, I'll check this. But I think that will help :D

manuel.aigner
Influencer
Posts: 18
Liked: 1 time
Joined: Sep 25, 2017 8:25 am
Full Name: Manuel Aigner
Contact:

Re: [FEATURE REQUEST] Assign SQL log shipping server to obje

Post by manuel.aigner » Feb 16, 2018 12:53 pm

Update:
Works perfectly :)

filipsmeets
Lurker
Posts: 2
Liked: never
Joined: Jun 26, 2019 3:28 pm
Full Name: Filip Smeets
Contact:

Log shipping

Post by filipsmeets » Jan 15, 2020 6:45 am

Is there a way to configure which log shipping servers should be used through powershell?

Guest Processing --> Enable Application Aware Processing --> Applications --> Edit --> SQL --> Log Shipping Servers.

Egor Yakovlev
Veeam Software
Posts: 827
Liked: 213 times
Joined: Jun 14, 2013 9:30 am
Full Name: Egor Yakovlev
Contact:

Re: [FEATURE REQUEST] Assign SQL log shipping server to object

Post by Egor Yakovlev » Jan 15, 2020 12:28 pm

Hi Filip,
I have moved your post to the existing feature request thread.
There is no native object property for Log Shipping Server yet, however please check a workaround provided by Tom.
Hope that helps!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests