PowerShell script exchange
Post Reply
neil1
Lurker
Posts: 2
Liked: never
Joined: Oct 20, 2023 1:03 am
Full Name: Neil Jackson
Contact:

Create a VBRComputerBackupJob with "OS Volume" as one of the selected volumes

Post by neil1 »

In the Veeam Backup and Replication Console GUI, I can specify "OS Volume" as one of the selected volumes for a Windows Agent job. How can the same thing be achieved in Veeam Powershell?

I have tried passing

Code: Select all

-SelectedVolumes @( "OS Volume" )
as an option to the

Code: Select all

Add-VBRComputerBackupJob
function, but this produces the error "Add-VBRComputerBackupJob: The specified computer backup job is invalid. Source: The Specified volume path is invalid: OS Volume\.".

As a test, I used the GUI to create a Windows Agent job named "xxtest" having "OS Volume" as its one and only selected volume. Then, I passed

Code: Select all

-SelectedVolumes @( (Get-VBRComputerBackupJob -Name "xxtest" ).SelectedVolumes[0] )
as an option to the

Code: Select all

Add-VBRComputerBackupJob
function. The function completed without errors and successfully created a new Windows Agent job with "OS Volume" as a selected volume. This test shows that it is possible to create a new VBRComputerBackupJob that has "OS Volume" as one of the Selected Volumes, but I am hoping for some technique that does not require a special manually-created existing VBRComputerBackupJob .
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Create a VBRComputerBackupJob with "OS Volume" as one of the selected volumes

Post by david.domask » 2 people like this post

Hi @@neil1,

Try passing "OS" to it; checking the backend code, it looks like it parses for this. Worked in my lab:

Image

I will write the Technical Writers and ask them to please update the documentation.
David Domask | Product Management: Principal Analyst
neil1
Lurker
Posts: 2
Liked: never
Joined: Oct 20, 2023 1:03 am
Full Name: Neil Jackson
Contact:

Re: Create a VBRComputerBackupJob with "OS Volume" as one of the selected volumes

Post by neil1 »

I can confirm that

Code: Select all

-SelectedVolumes @( "OS" )
does the trick. Thank you david.domask .

I agree that the "OS" value deserves to be mentioned in the documentation -- probably on the pages for the Add-VBRComputerBackupJob and Set-VBRComputerBackupJob functions. It would also be nice for the docs to say how to specify a volume based on GUID, if possible. "-SelectedVolumes '\\?\Volume{44aca03b-7976-4af1-adc6-965de358b69e}' ", for example, does not work.
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Create a VBRComputerBackupJob with "OS Volume" as one of the selected volumes

Post by david.domask »

Hi @@neil1, very glad to hear it worked. The TechWriters have already updated the documentation and added an example (#5):

https://helpcenter.veeam.com/docs/backu ... ml?ver=120

> It would also be nice for the docs to say how to specify a volume based on GUID, if possible. "-SelectedVolumes '\\?\Volume{44aca03b-7976-4af1-adc6-965de358b69e}' ", for example, does not work.

As best I can tell, the cmdlet is expecting a normal letter volume name. I think probably feature request on this one for VolumeID adding -- what is the use case if I can ask? Not saying it's a bad idea just curious on the use case.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests