PowerShell script exchange
Post Reply
jguillot
Novice
Posts: 9
Liked: never
Joined: Dec 12, 2017 6:36 pm
Contact:

How to add VSS Guest Credentials by vSphere Tags

Post by jguillot »

Hello,

I would like to set the VSS credentials of a backup job. And more specifically add VSS Guest Credentials by vSphere tags as criteria, without these tags being an object of the backup job (the job object is only a VMs folder).

How to do ?

thanks in advance
Mike Resseler
Product Manager
Posts: 8191
Liked: 1322 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by Mike Resseler »

Hu jguillot,

I don't think this is possible in the UI. (at least not if I understand the situation correctly). You have created one specific job, and that job points to a VM folder with X amount of VM's in. Some VMs will have different credentials for in-guest processing then others. Is that correct?


It might be possible to use PowerShell for this. If you can enumerate the VM's that are in a specific job, and then get the VMware tag for each VM and modify the guest credentials per VM. But in all honesty, never done this myself.
jguillot
Novice
Posts: 9
Liked: never
Joined: Dec 12, 2017 6:36 pm
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by jguillot »

Hi,

It's correct !

I already try to enumerate the VMs of a job but they become objects of the job whereas I just want to add these VMs in the guest processing credentials while just getting my VMs folder in the object of the job.

Thank's
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by veremin »

Unfortunately, you cannot do that in PowerShell. Thanks!
Henrik.Grevelund
Service Provider
Posts: 171
Liked: 26 times
Joined: Feb 13, 2017 2:56 pm
Full Name: Henrik Grevelund
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by Henrik.Grevelund »

Hi There,

It is possible using the GUI. But is it still not possible using powershell or maybee .net ?

I have 40 backup jobs i would to add 1 credential to
Have nice day,
Henrik
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by oleg.feoktistov »

Hi Henrik,

It's not available in neither powershell, nor .net since primary backup / backup copy job management is built a bit differently here.
Most of the options for, say, a backup job, you amend inside job options properties and then update them on job object directly rather than passing it all through different sets of cmdlet parameters. It leads to the necessity of passing explicit ids when it comes to specific entities or strings/integers when it comes to other adjustments.
So, the way to set one credential for all the job includes could be:

Code: Select all

$jobs = Get-VBRJob
$creds = Get-VBRCredentials -Name 'Administrator'
foreach ($job in $jobs) {
  $objects = Get-VBRJobObject -Job $job
  foreach ($object in $objects) {
    $vssOptions = Get-VBRJobObjectVssOptions -ObjectInJob $object
    $vssOptions.WinCredsId = $creds.Id
    Set-VBRJobObjectVssOptions -Object $object -Options $vssOptions
   } 
}
Thanks,
Oleg
Henrik.Grevelund
Service Provider
Posts: 171
Liked: 26 times
Joined: Feb 13, 2017 2:56 pm
Full Name: Henrik Grevelund
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by Henrik.Grevelund »

Hi Oleg,

Thank you for the example. It will help a little next time.
Now I only have to add the vmware tag in the guest OS credentials window, and then use your script to set the user credentials.
Have nice day,
Henrik
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by oleg.feoktistov »

Hi Henrik,

Yes, it works this way since what you see in the UI (choosing credentials by Vmware tags, for instance) is literally filtering views. While in API like PS or REST you need to do the filtering beforehand as a separate step and then pass explicit values to flat objects/models.

Thanks,
Oleg
Henrik.Grevelund
Service Provider
Posts: 171
Liked: 26 times
Joined: Feb 13, 2017 2:56 pm
Full Name: Henrik Grevelund
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by Henrik.Grevelund »

Hi Oleg,

Will it be possible to add VMware tags in version 11 ?
Have nice day,
Henrik
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: How to add VSS Guest Credentials by vSphere Tags

Post by oleg.feoktistov »

Not planned for v11. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests