I had a problem with this cmdlet.
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>