PowerShell script exchange
Post Reply
jasonpearce
Influencer
Posts: 23
Liked: 5 times
Joined: Mar 11, 2015 2:31 pm
Full Name: Jason Pearce
Contact:

Set-VBRJobObjectVssOptions -Credentials

Post by jasonpearce »

Will someone please demonstrate how to correctly use the -Credentials parameter for the Set-VBRJobObjectVssOptions cmdlet?

For example, if I use the Get-VBRCredentials I get the following.

Code: Select all

Get-VBRCredentials

Name					Description
----					----------
domain\veeambr		Veeam Backup and Recovery Account
root					FLR helper appliance credentials


Get-VBRCredentials -Name "*veeambr*"

Name					Description
----					----------
domain\veeambr		Veeam Backup and Recovery Account
So I would think that the following code should work.

Code: Select all

$VBRCredentials = Get-VBRCredentials -Name "*veeambr*"

Get-VBRJob -Name "Test-Job" | Get-VBRJobObject -Name * | Set-VBRJobObjectVssOptions -Options $SomeOptionsIDefinedViaNewVBRJobVssOptions -Credentials $VBRCredentials
The Set-VBRJobObjectVssOptions cmdlet works if I do not include the -Credentials parameter. And I've tried the following options for the -Credentials parameter:

Code: Select all

-Credentials domain\veeambr
-Credentials "domain\veeambr"
-Credentials $VBRCredentials
-Credentials $VBRCredentials.Name
Each time, I get the following error:

Code: Select all

Set-VBRJobObjectVssOptions : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:57
+ Get-VBRJob -Name $job.Name | Get-VBRJobObject -Name * | Set-VBRJobObjectVssOptio ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-VBRJobObjectVssOptions], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Veeam.Backup.PowerShell.Command.SetVBRJobObjectVssOptions
Unfortunately, neither the Get-Help Set-VBRJobObjectVssOptions -examples nor Veeam's online documentation provide and example of how to correctly use the -Credentials parameter. If someone can find documentation on how to use this parameter in this cmdlet, please chime in.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by veremin »

Let's first clarify what you want to achieve. You're willing to set different account for different source VMs, right? (Guest Processing -> Customize guest OS credentials for individual VMs -> Credentials)
jasonpearce
Influencer
Posts: 23
Liked: 5 times
Joined: Mar 11, 2015 2:31 pm
Full Name: Jason Pearce
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by jasonpearce »

I'm am attempting to do the opposite. I'm attempting to write a script that will change all of my existing backup jobs to have more uniform settings. One of the desired changes is to have them all use the same set of credentials.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by veremin »

So, the main idea is to reset these settings

Image

and use this one, instead?

Image

Thanks.
jasonpearce
Influencer
Posts: 23
Liked: 5 times
Joined: Mar 11, 2015 2:31 pm
Full Name: Jason Pearce
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by jasonpearce »

Correct. I don't actually make use of the "GUI > Edit Backup Job > Guest Processing > Customize guest OS credentials for individual VMs and operating systems" (e.g. all Guest OS Credentials are set to <Default>). I do make use of "GUI > Edit Backup Job > Guest Processing > Guest OS credentials > Credentials." We have a variety of credentials under "GUI > Edit Backup Job > Guest Processing > Manage Credentials" available in assigned to different backup jobs.

I'd like to have a PowerShell script to change all of the backup jobs to use the same Account/Credentials, among other settings.

Perhaps you are suggesting that I'm targeting the wrong place to set my credentials. And I think based on my earlier code example, you're right.

Instead of ...

Code: Select all

$VBRCredentials = Get-VBRCredentials -Name "*veeambr*"

Get-VBRJob -Name "Test-Job" | Get-VBRJobObject -Name * | Set-VBRJobObjectVssOptions -Options $SomeOptionsIDefinedViaNewVBRJobVssOptions -Credentials $VBRCredentials
... my example should have been for the job, not the job objects, like so ...

Code: Select all

$VBRCredentials = Get-VBRCredentials -Name "*veeambr*"

Get-VBRJob -Name "Test-Job" | Set-VBRJobVssOptions -Options $SomeOptionsIDefinedViaNewVBRJobVssOptions -Credentials $VBRCredentials
I also tried using the Set-VBRJobVssOptions instead of Set-VBRJobObjectVssOptions without success. I cannot figure out how to correctly use the -Credentials parameter in either example, nor find documentation on what type of values should be used for this parameter.

Here is the full script that I'm working on.

Code: Select all

# Clear the screen
Clear

# Get all backup jobs
# $jobs = Get-VBRJob | Where-Object { $_.IsBackup -eq $true }

# For testing, target just one job instead of all jobs
$jobs = Get-VBRJob -Name "Test-Job"

# BEFORE making changes to anything
$beforeJobVss = Get-VBRJob -Name $job.Name | Get-VBRJobVssOptions
$beforeJobObjectVss = Get-VBRJob -Name $job.Name | Get-VBRJobObject -Name * | Get-VBRJobObjectVssOptions

# BEGIN foreach loop ################

# Make the following changes to all backup jobs
foreach ($job in $jobs) {

	# BEGIN Job VSS Options #################

		# Create Job Processing Options 
		$jobVssOptions = New-VBRJobVssOptions
		$jobVssOptions.VssSnapshotOptions.Enabled=$true
		$jobVssOptions.VssSnapshotOptions.IgnoreErrors=$false
		$jobVssOptions.Enabled=$true
		$jobVssOptions.IgnoreErrors=$false

		# Get Credentials
		$credentials = Get-VBRCredentials -Name "*veeam*"

		# Apply Job Processing Options with Credentials (Ugh! How do I get -Credentials to work?)
		# Get-VBRJob -Name $job.Name | Set-VBRJobVssOptions -Options $jobVssOptions -Credentials $credentials

		# Apply Job Processing Options without Credentials
		Get-VBRJob -Name $job.Name | Set-VBRJobVssOptions -Options $jobVssOptions

	# END Job VSS Options ####################
	# BEGIN Job Object VSS Options #################

		# Create Guest Processing Options 
		$jobVssObjectOptions = New-VBRJobVssOptions
		$jobVssObjectOptions.VssSnapshotOptions.Enabled=$true
		$jobVssObjectOptions.VssSnapshotOptions.IgnoreErrors=$true
		$jobVssObjectOptions.Enabled=$true
		$jobVssObjectOptions.IgnoreErrors=$true

		# Get Credentials (commented out because it should inherit from Set-VBRJobVssOptions)
		# $credentials = Get-VBRCredentials -Name "*veeam*"

		# Apply Guest Processing Options with Credentials (shouldn't be needed because credentials should be inherited from job)
		# Get-VBRJob -Name $job.Name | Get-VBRJobObject -Name * | Set-VBRJobObjectVssOptions -Options $jobVssObjectOptions -Credentials $credentials

		# Apply Guest Processing Options without Credentials
		Get-VBRJob -Name $job.Name | Get-VBRJobObject -Name * | Set-VBRJobObjectVssOptions -Options $jobVssObjectOptions

	# END Job Object VSS Options ####################

	# Report which jobs received these changes
	Write-Host "Changed settings for" $job.Name
}
# END foreach loop ################

# AFTER making changes
$afterJobVss = Get-VBRJob -Name $job.Name | Get-VBRJobVssOptions
$afterJobObjectVss = Get-VBRJob -Name $job.Name | Get-VBRJobObject -Name * | Get-VBRJobObjectVssOptions

# COMPARE JobVss results
$beforeJobVss
$afterJobVss

# COMPARE JobObjectVss results
$beforeJobObjectVss
$afterJobObjectVss
jasonpearce
Influencer
Posts: 23
Liked: 5 times
Joined: Mar 11, 2015 2:31 pm
Full Name: Jason Pearce
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by jasonpearce »

My intention here is not to have someone poor over my script. I posted the full script to provide context.

What I'm really seeking are examples on how to use the -Credential(s) parameter correctly when using either the Set-VBRJobVssOptions or Set-VBRJobObjectVssOptions cmdlets.

It is important to note the spelling inconstancy of this parameter. For some reason, one parameter is singular while the other is plural. Perhaps it implies that for the parameter that is plural, multiple credentials can be entered as values.

http://helpcenter.veeam.com/backup/80/p ... tions.html uses the singular parameter:

Code: Select all

Set-VBRJobVssOptions [-Job] <CBackupJob[]> [-Options] <CVssOptions> -Credential <CCredentials>
http://helpcenter.veeam.com/backup/80/p ... tions.html uses the plural parameter:

Code: Select all

Set-VBRJobObjectVssOptions [-Object] <CObjectInJob> -Credentials <CCredentials>
Both state "Specifies the credentials you want to use for authenticating with the guest VM", using the plural form of credentials in both descriptions. Perhaps this is another inconsistent typographical error in Veeam's PowerShell (e.g. note how the parameter -Periodicaly is misspelled while the following parameter -PeriodicallyKind is spelled correctly in this cmdlet Set-VBRJobSchedule -Job <CBackupJob[]> [-Periodicaly] [-FullPeriod <Int32>] [-PeriodicallyKind <PeriodicallyOptions+PeriodicallyKinds>]).

Neither document nor Get-Help results provide an example of how to use -Credential or -Credentials in these two cmdlets. What values may I enter that would be accepted?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by veremin »

My intention here is not to have someone poor over my script. I posted the full script to provide context.
Set-VBRJobVSSOptions -Credentials sets AAIP credentials on job level:

Code: Select all

$Job = Get-VBRJob -Name "Temp VM"
Set-VBRJobVssOptions -Job $Job -Credentials (Get-VBRCredentials -Name "Test01")
Image

Set-VBRJobObjectVssOptions -Credentials set credentials on job object level:

Code: Select all

$JobObject = $Job | Get-VBRJobObject -Name "Temp VM"
Set-VBRJobObjectVssOptions -Object $JobObject -Credentials (Get-VBRCredentials -Name "Test02")
Image

As to our online help center, whenever you feel the information provided there is either misleading or incomplete you can use the "send feedback" link at the bottom of the page. Tech writers team behind that resource reacts to such feedback in timely fashion.

Speaking about -Periodically switch, I will notify required team in order to correct it.

Thanks.
jasonpearce
Influencer
Posts: 23
Liked: 5 times
Joined: Mar 11, 2015 2:31 pm
Full Name: Jason Pearce
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by jasonpearce »

Thank you for the clarification and documentation on how to use that parameter.

Regarding the -Periodicaly parameter, it appears that the misspelling is not an error in the documentation but is instead an error in the Veeam PowerShell language:

Code: Select all

Set-VBRJobSchedule -Job  [-Periodicaly] [-FullPeriod ] [-PeriodicallyKind ])
If I spell the parameter correctly (as -Periodically), I receive an error.

Regarding the -Credential vs -Credentials parameter inconsistency (singular vs plural), I am uncertain if that is a documentation error or another Veeam PowerShell issue.

Code: Select all

Set-VBRJobVssOptions [-Job]  [-Options]  -Credential  [-WarningAction ] [-WarningVariable ] []
Set-VBRJobObjectVssOptions [-Object]  -Credentials  [-WarningAction ] [-WarningVariable ] []
Can you determine if this inconsistency is a documentation or syntax error? At first I thought it was a documentation error because Get-Help for both cmdlets used the plural version. But when I test the singular version of the cmdlet, I do not get an error. What is the correct tense of this parameter, and is that tense the same across all cmdlets?

Lastly, thank you for pointing out how to provide feedback to the online documentation. Is that the same method I'd used to provide feedback to the Get-Help content? How to I download and obtain updated Get-Help content?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by veremin »

Regarding the -Periodicaly parameter, it appears that the misspelling is not an error in the documentation but is instead an error in the Veeam PowerShell language:
You're right the typo is in PowerShell snap-in. It might be tricky to correct it, though. As it can probably affect number of existing scripts. Anyway, we will think how we can address it in the next release.
Regarding the -Credential vs -Credentials parameter inconsistency (singular vs plural), I am uncertain if that is a documentation error or another Veeam PowerShell issue.
In both commandlets -Credentials should be plural.
Is that the same method I'd used to provide feedback to the Get-Help content?
Yep, I believe you can provide your feedback regarding Get-Help commandlet there as well.
How to I download and obtain updated Get-Help content?

Content of Get-Help typically gets updated with every major release of our product.

Thanks.
jasonpearce
Influencer
Posts: 23
Liked: 5 times
Joined: Mar 11, 2015 2:31 pm
Full Name: Jason Pearce
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by jasonpearce »

Thank you.
As it can probably affect number of existing scripts. Anyway, we will think how we can address it in the next release.
Perhaps the solution is to accept either parameters as valid parameters. E.g. -Periodicaly or -Periodically. Your team has already created several cmdlets that have different scopes. See http://helpcenter.veeam.com/backup/80/p ... tions.html.
In both commandlets -Credentials should be plural
Great. That's easier for you to fix as it should just require updating your documentation.
Content of Get-Help typically gets updated with every major release of our product.
Ok. But would be ideal of your Help documentation could be updated out of cycle using a command similar to Update-Help; perhaps Update-VBRHelp. Thanks for your time.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by veremin »

Perhaps the solution is to accept either parameters as valid parameters. E.g. -Periodicaly or -Periodically.
Yep, I was thinking more or less similarly. Will what can be done in this regard.
Great. That's easier for you to fix as it should just require updating your documentation.
I've notified the responsible team already; should be fixed soon.

Thanks.
jasonpearce
Influencer
Posts: 23
Liked: 5 times
Joined: Mar 11, 2015 2:31 pm
Full Name: Jason Pearce
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by jasonpearce »

I'm still having problems using the -Credentials parameter for some cmdlets. In this case, I'm having a problem with the Set-VBRJobVssOptions cmdlet.

I created a dummy Guest Processing > Guest OS Credentials > Credentials account named "testdummy". If I use the Get-VBRCredentials cmdlet, I can retrieve it just fine and without error:

Code: Select all

PS C:\> Get-VBRCredentials -Name test*

Name                           Description
----                           -----------
testdummy                      testdummy
But if I attempt to use the exact same cmdlet as a value for the -Credentials parameter, I get an error. Note that the values in the other variables are fine, as the Set-VBRJobVssOptions cmdlet will work if I exclude the -Credentials parameter:

Code: Select all

PS C:\> Set-VBRJobVssOptions -Job $job -Options $VssOptions -Credentials (Get-VBRCredentials -Name test*)
Set-VBRJobVssOptions : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Set-VBRJobVssOptions -Job $job -Options $VssOptions -Credentials (Get-VBRCredent ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-VBRJobVssOptions], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Veeam.Backup.PowerShell.Command.SetVBRJobVssOptions
I appear to be back at my original problem in that I cannot figure out how to provide the -Credentials parameter a value that it will except. The example you provided earlier in this forum seemed logical, but I am unable to duplicate your success. I'm using Veeam BR version 8 with update 1.
jasonpearce
Influencer
Posts: 23
Liked: 5 times
Joined: Mar 11, 2015 2:31 pm
Full Name: Jason Pearce
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by jasonpearce » 2 people like this post

I think I figured it out. I've found yet another Veeam PowerShell documentation error.

Reference: http://helpcenter.veeam.com/backup/80/p ... tions.html

If you look at the Set-VBRJobVssOptions, the online documented Syntax is:

Code: Select all

Set-VBRJobVssOptions [-Job] <CBackupJob[]> [-Options] <CVssOptions> -Credential <CCredentials> [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]
We've already determined that the first online documentation error is that it uses the singular-tense -Credential parameter (incorrect) when it is supposed to be the plural-tense -Credentials parameter (correct).

Accounting for the plural-tense adjustment, my script meets the documented-online Syntax requirements:

Code: Select all

Set-VBRJobVssOptions -Job $job -Options $VssOptions -Credentials (Get-VBRCredentials -Name test*)
Yet when I run the Set-VBRJobVssOptions cmdlet with all three -Job, -Options, and -Credentials (plural) parameters (as documented), I get this error:

Code: Select all

PS C:\> Set-VBRJobVssOptions -Job $job -Options $VssOptions -Credentials (Get-VBRCredentials -Name test*)
Set-VBRJobVssOptions : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Set-VBRJobVssOptions -Job $job -Options $VssOptions -Credentials (Get-VBRCredent ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-VBRJobVssOptions], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Veeam.Backup.PowerShell.Command.SetVBRJobVssOptions
It turns out that I found a second problem with the online documentation.

If you look at Get-Help Set-VBRJobVssOptions -full, it has two Syntax descriptions, not one. The first has both the -Job and -Options parameters, but no -Credentials parameter as described in the online documentation. The second Syntax description has both the -Job and -Credentials parameters, but no -Options.

Code: Select all

PS C:\> Get-help Set-VBRJobVssOptions -full

NAME
    Set-VBRJobVssOptions

SYNOPSIS
    Applies custom VSS settings to a selected job.

SYNTAX
    Set-VBRJobVssOptions [-Job] <CBackupJob[]> [-Options] <CGuestProcessingOptions> [-WarningAction
    <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]

    Set-VBRJobVssOptions [-Job] <CBackupJob[]> -Credentials <CCredentials> [-WarningAction <ActionPreference>]
    [-WarningVariable <String>] [<CommonParameters>]
I've once again been misled by Veeam's online documentation. To properly set both the VSS Options and the VSS Credentials for a job, one cannot use all three parameters at the same time and instead must run the cmdlet twice, each time using just two of the three parameters, like so:

Code: Select all

Set-VBRJobVssOptions -Job $job -Options $VssOptions

Set-VBRJobVssOptions -Job $job -Credentials (Get-VBRCredentials -Name Test*)
That works.

Veeam's online documentation inconsistencies have made learning and using Veeam PowerShell this past week a frustrating experience (see https://www.jasonpearce.com/2015/03/12/ ... istencies/). The Get-Help documentation is more accurate than the documentation found online. It was naive of me to assume online and embedded documentation would be the same and equally accurate.

To avoid misleading other users, Veeam should replace all of its online Veeam PowerShell documentation with an exact copy of the documentation that can be retrieved via Get-Help. That way the online documentation would at least be consistent, and likely more accurate.

If the online documentation matched the Get-Help documentation, three of the four problems I've experienced this week would not have been an issue. In the meantime, my lesson is to stop referencing the online documentation as it misleading and contains several errors.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by veremin »

The PS section of our online Help Center has been revised seriously with the release of version 8 to be better structured and be more convenient for end-users. Comparing with its previous version, I can say that those goals have been achieved.

Some minor issues are still present, though. But the corresponding team is working hard to address.

I've passed your feedback to techwritters, so, the mentioned inconsistencies should be fixed soon.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by veremin »

The said inconsistency has been already fixed in the online documentation. Try to refresh the referenced page, using Ctrl+F5.
Syntax

Set-VBRJobVssOptions [-Job] <CBackupJob[]> [-Options] <CGuestProcessingOptions> [<CommonParameters>]

-OR-

Set-VBRJobVssOptions [-Job] <CBackupJob[]> -Credentials <CCredentials> [<CommonParameters>]
Thanks.
jevao
Enthusiast
Posts: 29
Liked: 3 times
Joined: Oct 28, 2011 11:38 pm
Full Name: James Collison
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by jevao »

I had a problem with this cmdlet.

Code: Select all

Set-VBRJobVssOptions -Job $Job -Credentials (Get-VBRCredentials -Name "vc\veeam")
I am guessing the problem happens if you have multiple credentials with the same name. It returns an array of multiple credentials and throws the error because the cmdlet sees the array, but when you run "get-vbrcredentails -name "vc\veeam" | gm" by itself, it shows the Ccredentials object, not the array.

Code: Select all

PS C:\users\veeam\scripts\addbk> set-vbrjobvssoptions -job $job -Credentials (get-vbrcredentials -name "vc\veeam")
Set-VBRJobVssOptions : Cannot convert 'System.Object[]' to the type 'Veeam.Backup.Common.CCredentials' required by parameter 
'Credentials'. Specified method is not supported.
At line:1 char:45
+ set-vbrjobvssoptions -job $job -Credentials (get-vbrcredentials -name "vc\veeam ...
+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-VBRJobVssOptions], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Veeam.Backup.PowerShell.Command.SetVBRJobVssOptions
 

PS C:\users\veeam\scripts\addbk> $e = Get-VBRCredentials -name "vc\veeam"

PS C:\users\veeam\scripts\addbk> $e | gm


   TypeName: Veeam.Backup.Common.CCredentials

Name                 MemberType Definition                                                                 
----                 ---------- ----------                                                                 
Clone                Method     System.Object Clone(), System.Object ICloneable.Clone()                    
Equals               Method     bool Equals(System.Object obj)                                             
FormatChangeTime     Method     string FormatChangeTime()                                                  
GetHashCode          Method     int GetHashCode()                                                          
GetSHA256Password    Method     string GetSHA256Password(Veeam.Backup.Common.CCredentials self)            
GetType              Method     type GetType()                                                             
Serial               Method     void Serial(System.Xml.XmlNode node)                                       
Serialize            Method     string Serialize()                                                         
SetEncryptedPassword Method     void SetEncryptedPassword(string encryptedPassword)                        
SetPassword          Method     void SetPassword(string password)                                          
SplitUsername        Method     void SplitUsername([ref] string domain, [ref] string usernameWithoutDomain)
ToNetworkCredential  Method     System.Net.NetworkCredential ToNetworkCredential()                         
ToString             Method     string ToString()                                                          
ToXmlData            Method     Veeam.Backup.Common.CInputXmlData ToXmlData()                              
ChangeTimeLocal      Property   System.Nullable[datetime] ChangeTimeLocal {get;}                           
ChangeTimeUtc        Property   System.Nullable[datetime] ChangeTimeUtc {get;set;}                         
CurrentUser          Property   bool CurrentUser {get;set;}                                                
Description          Property   string Description {get;set;}                                              
DomainName           Property   string DomainName {get;}                                                   
EncryptedPassword    Property   string EncryptedPassword {get;set;}                                        
IsEmpty              Property   bool IsEmpty {get;}                                                        
IsLocalProtect       Property   bool IsLocalProtect {get;set;}                                             
Name                 Property   string Name {get;}                                                         
UserName             Property   string UserName {get;set;}                                                 
UserNameOnly         Property   string UserNameOnly {get;}                                                 



PS C:\users\veeam\scripts\addbk> $f = $e[0]

PS C:\users\veeam\scripts\addbk> $f | gm


   TypeName: Veeam.Backup.Common.CCredentials

Name                 MemberType Definition                                                                 
----                 ---------- ----------                                                                 
Clone                Method     System.Object Clone(), System.Object ICloneable.Clone()                    
Equals               Method     bool Equals(System.Object obj)                                             
FormatChangeTime     Method     string FormatChangeTime()                                                  
GetHashCode          Method     int GetHashCode()                                                          
GetSHA256Password    Method     string GetSHA256Password(Veeam.Backup.Common.CCredentials self)            
GetType              Method     type GetType()                                                             
Serial               Method     void Serial(System.Xml.XmlNode node)                                       
Serialize            Method     string Serialize()                                                         
SetEncryptedPassword Method     void SetEncryptedPassword(string encryptedPassword)                        
SetPassword          Method     void SetPassword(string password)                                          
SplitUsername        Method     void SplitUsername([ref] string domain, [ref] string usernameWithoutDomain)
ToNetworkCredential  Method     System.Net.NetworkCredential ToNetworkCredential()                         
ToString             Method     string ToString()                                                          
ToXmlData            Method     Veeam.Backup.Common.CInputXmlData ToXmlData()                              
ChangeTimeLocal      Property   System.Nullable[datetime] ChangeTimeLocal {get;}                           
ChangeTimeUtc        Property   System.Nullable[datetime] ChangeTimeUtc {get;set;}                         
CurrentUser          Property   bool CurrentUser {get;set;}                                                
Description          Property   string Description {get;set;}                                              
DomainName           Property   string DomainName {get;}                                                   
EncryptedPassword    Property   string EncryptedPassword {get;set;}                                        
IsEmpty              Property   bool IsEmpty {get;}                                                        
IsLocalProtect       Property   bool IsLocalProtect {get;set;}                                             
Name                 Property   string Name {get;}                                                         
UserName             Property   string UserName {get;set;}                                                 
UserNameOnly         Property   string UserNameOnly {get;}                                                 



PS C:\users\veeam\scripts\addbk> set-vbrjobvssoptions -job $job -Credentials $f


FreeBackupImpl               : 
IsFree                       : False
UserCryptoKey                : 
Id                           : f08b05fa-9a5e-4bff-93c0-597100d2290c
Info                         : Veeam.Backup.Model.CDbBackupJobInfo
JobType                      : Backup
SourceType                   : VDDK
JobTargetType                : Backup
TargetType                   : Other
TypeToString                 : VMware Backup
Description                  : Created by Powershell at 7/13/2015 7:17:24 PM.
Name                         : Windows-34
BackupPlatform               : EVmware
TargetHostId                 : fabd70d6-f72b-4aaa-8e84-09728c36dbbb
TargetDir                    : /cargobay3d/backups
TargetFile                   : Windows-34
Options                      : Veeam.Backup.Model.CJobOptions
IsContinuous                 : False
NameWithDescription          : Windows-34 (Created by Powershell at 7/13/2015 7:17:24 PM.)
SqlEnabled                   : False
ParentJobId                  : 
HvReplicaTargetOptions       : Veeam.Backup.Model.CDomHvReplicaTargetOptions
BackupStorageOptions         : Veeam.Backup.Model.CDomBackupStorageOptions
BackupTargetOptions          : Veeam.Backup.Model.CDomBackupTargetOptions
HvSourceOptions              : Veeam.Backup.Model.CDomHvSourceOptions
JobOptions                   : Veeam.Backup.Model.CDomJobOptions
NotificationOptions          : Veeam.Backup.Model.CDomNotificationOptions
JobScriptCommand             : Veeam.Backup.Model.CDomJobScriptCommand
ViReplicaTargetOptions       : Veeam.Backup.Model.CDomViReplicaTargetOptions
ViSourceOptions              : Veeam.Backup.Model.CDomViSourceOptions
VssOptions                   : VssSnapshotOptions: [Enabled: [True], IgnoreErrors: [False], IsCopyOnly: [False]], 
                               WinGuestFSIndexingOptions: [Type: [None]], LinGuestFSIndexingOptions: [Type: [None]], 
                               SqlBackupOptions: [TransactionLogsProcessing: [TruncateOnlyOnSuccessJob], BackupLogsFrequencyMin: 
                               [15], UseDbBackupRetention: [True], RetainDays: [15], ProxyAutoSelect: [True]], 
                               ExchangeBackupOptions: [TransactionLogsProcessing: [TruncateOnlyOnSuccessJob]], WinCredsId: 
                               [b6926eec-58c1-43c1-a024-2a7564e57063], LinCredsId: [00000000-0000-0000-0000-000000000000], Old 
                               Properties: [Enabled: [True], IgnoreErrors: [False], GuestFSIndexingType: [None], 
                               IncludedIndexingFolders: [], ExcludedIndexingFolders: [], LinGuestFSIndexingType: [None], 
                               LinIncludedIndexingFolders: [], LinExcludedIndexingFolders: [], IsFirstUsage: [True]]
ScheduleOptions              : Start time: [7/24/2015 10:10:00 PM], Latest run time: [7/16/2015 10:10:02 PM], Next run time: [], 
                               Daily options: [Enabled: True, DayNumberInMonth: SelectedDays, Days: Monday, Tuesday, Wednesday, 
                               Thursday, Friday]Monthly options: [Enabled: False, Time: 7/13/2015 10:00:00 PM, Day Number In Month: 
                               Fourth, Day Of Week: Saturday, Months: January, February, March, April, May, June, July, August, 
                               September, October, November, December]Periodically options: [Enabled: False, Period: 1 hour(s), 
                               ScheduleString: <scheduler><Sunday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Sunday><Monday>0,0
                               ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Monday><Tuesday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                               0,0,0,0</Tuesday><Wednesday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Wednesday><Thursday>0,0,0
                               ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Thursday><Friday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
                               ,0,0,0</Friday><Saturday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Saturday></scheduler>, 
                               HourlyOffset: 0]Continuous options: [Enabled: False, ScheduleString: <scheduler><Sunday>0,0,0,0,0,0,0,
                               0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Sunday><Monday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Mon
                               day><Tuesday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Tuesday><Wednesday>0,0,0,0,0,0,0,0,0,0,0
                               ,0,0,0,0,0,0,0,0,0,0,0,0,0</Wednesday><Thursday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Thurs
                               day><Friday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Friday><Saturday>0,0,0,0,0,0,0,0,0,0,0,0,
                               0,0,0,0,0,0,0,0,0,0,0,0</Saturday></scheduler>]
IsRunning                    : False
IsRequireRetry               : 
IsIddle                      : True
IsScheduleEnabled            : False
SourceProxyAutoDetect        : False
IsInitialReplica             : False
IsMappingReplica             : False
IsBackup                     : True
IsBackupSync                 : False
IsSnapshotReplica            : False
IsLegacyReplica              : False
IsReplica                    : False
IsVmCopy                     : False
IsTapeBackup                 : False
IsFileTapeBackup             : False
IsVmTapeBackup               : False
LinkedJobs                   : {}
LinkedJobIds                 : {}
LinkedRepositories           : {}
LinkedRepositoryIds          : {}
IsForeverIncremental         : False
IsBackupJob                  : True
IsEndpointJob                : False
AutoScheduleOptions          : Veeam.Backup.Model.CAutoScheduleOptions
PreviousJobIdInScheduleChain : 




PS C:\users\veeam\scripts\addbk> set-vbrjobvssoptions -job $job -Credentials $e
Set-VBRJobVssOptions : Cannot convert 'System.Object[]' to the type 'Veeam.Backup.Common.CCredentials' required by parameter 
'Credentials'. Specified method is not supported.
At line:1 char:45
+ set-vbrjobvssoptions -job $job -Credentials $e
+                                             ~~
    + CategoryInfo          : InvalidArgument: (:) [Set-VBRJobVssOptions], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Veeam.Backup.PowerShell.Command.SetVBRJobVssOptions
 

PS C:\users\veeam\scripts\addbk> 

veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobObjectVssOptions -Credentials

Post by veremin »

It must be something specific to your environment, as I've just tested the given commandlet and everything seems to have worked properly.

If I remember correctly you've migrated recently your VB&R installation, so, probably you just come across another remnant related to it.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests