Code: Select all
$NetCreds = Get-VBRCredentials -Name "admin"
Code: Select all
$ZIPSession = Start-VBRZip -Entity $VM -Folder $Directory -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention -EncryptionKey $EncryptionKey -NetworkCredentials $NetCreds
Code: Select all
Start-VBRZip : Cannot convert 'System.Object[]' to the type 'Veeam.Backup.Common.CCredentials' required by parameter 'NetworkCredentials'. Specified method
is not supported.
At C:\scripts\VeeamZIP.ps1:92 char:174
+ ... nableQuiescence) -AutoDelete $Retention -NetworkCredentials $NetCreds
+ ~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-VBRZip], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Veeam.Backup.PowerShell.Cmdlets.StartVBRZip
Code: Select all
Get-VBRCredentials -Name "admin"
Code: Select all
PS C:\scripts> Get-VBRCredentials -Name "admin"
Id : 3c88fc47-5bc6-4757-9127-61e5ac97331d
IsLocalProtect : True
Name : admin
CurrentUser : False
UserName : admin
UserNameOnly : admin
DomainName : .
EncryptedPassword :
Description : admin
ChangeTimeLocal : 1/11/2017 1:14:49 PM
ChangeTimeUtc : 1/11/2017 3:14:49 AM
IsEmpty : False
PasswordIsNull : True
Id : 22991cc8-f227-440c-8191-d90fc178d9f5
IsLocalProtect : True
Name : admin
CurrentUser : False
UserName : admin
UserNameOnly : admin
DomainName : .
EncryptedPassword :
Description : NAS admin
ChangeTimeLocal : 30/10/2017 9:59:20 AM
ChangeTimeUtc : 29/10/2017 11:59:20 PM
IsEmpty : False
PasswordIsNull : True
It works beautifully when backing up to local storage, but then that doesn't need credentials.
Sean