PowerShell script exchange
jlsung
Influencer
Posts: 21 Liked: never
Joined: Sep 15, 2011 1:41 pm
Contact:
Post
by jlsung » Jan 04, 2012 10:10 am
this post
Hello,
I've modified VssChild object credentials (B&R 5.0.2)by the code below :
Code: Select all
$Credentials = New-Object -TypeName Veeam.Backup.Common.CCredentials -ArgumentList $login,$password,0,0
$Options = $VssChild.GetVssOptions()
$Options.Credentials = $Credentials
$VssChild.SetVssOptions($Options)
Error message :
Cannot login into the virtual machine: [[SAN0xxxx] xxxxxx.vmx]. User: [xxxxxx].
VIX Error: The guest does not support empty passwords Code: 3033
When I checked the the VssChild object, the password field is not empty...
Any idea ?
Thanks,
Sethbartlett
Veteran
Posts: 282 Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:
Post
by Sethbartlett » Jan 04, 2012 12:48 pm
this post
I'm not sure what $VssChild is, unless that is your job? Typically you would want to do:
Code: Select all
$Job = Get-VBRJob -name "MyJob"
$VSS = $Job.GetVssOptions()
$Credentials = New-Object -TypeName Veeam.Backup.Common.CCredentials -ArgumentList "User","Password",0,0
$VSS.Credentials = $Credentials
Job.SetVssOptions($VSS)
Skype:
Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @
sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
jlsung
Influencer
Posts: 21 Liked: never
Joined: Sep 15, 2011 1:41 pm
Contact:
Post
by jlsung » Jan 04, 2012 2:15 pm
this post
$Vsschild is an object in my job.
I want to set an username and password for each VM my job. Credentials are different for each VM.
The issue is the field username/password are not empty but I've got the error
VIX Error: The guest does not support empty passwords Code: 3033
ThomasMc
Veteran
Posts: 293 Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:
Post
by ThomasMc » Jan 04, 2012 3:06 pm
this post
Your object might have a password set but that doesn't mean the job was updated properly and thus still have a blank password, I've tested it this way and works as expected
Code: Select all
PS C:\> $job = Get-VBRJob -Name "Backup Job"
PS C:\> $jobVSS = $job | Get-VBRJobVSSOptions
PS C:\> $Credentials = New-Object -TypeName Veeam.Backup.Common.CCredentials -ArgumentList "lab\administrator","HisPass",0,0
PS C:\> $jobVSS.Credentials = $Credentials
PS C:\> $job | Set-VBRJobVssOptions -Options $jobVSS
ThomasMc
Veteran
Posts: 293 Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:
Post
by ThomasMc » Jan 04, 2012 3:14 pm
this post
ah never mind I get you now, I'll be back
ThomasMc
Veteran
Posts: 293 Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:
Post
by ThomasMc » Jan 04, 2012 3:53 pm
this post
This any good to you
Code: Select all
function Set-JOBJVSSOpt {
param(
[PsObject]$VSSObj,
[String]$Username,
[String]$Password,
[String]$Domain
)
Begin {
$Credentials = New-Object -TypeName Veeam.Backup.Common.CCredentials -ArgumentList "$Domain\$Username","$Password",0,0
}
Process {
$VSSObjCreds = $VSSObj.GetVSSOptions()
$VSSObjCreds.Credentials = $Credentials
}
End {
$VSSObj.SetVssOptions($VSSObjCreds)
}
}
PS C:\> $job = Get-VBRJob -Name "Backup Job 4"
PS C:\> $jobObjs = $job | Get-VBRJobObject
PS C:\> $jobObjs | %{Set-JOBJVSSOpt $_ "UserName" "Password" "Domain"}
jlsung
Influencer
Posts: 21 Liked: never
Joined: Sep 15, 2011 1:41 pm
Contact:
Post
by jlsung » Jan 04, 2012 4:37 pm
this post
ThomasMc wrote: Your object might have a password set but that doesn't mean the job was updated properly and thus still have a blank password, I've tested it this way and works as expected
Code: Select all
PS C:\> $job = Get-VBRJob -Name "Backup Job"
PS C:\> $jobVSS = $job | Get-VBRJobVSSOptions
PS C:\> $Credentials = New-Object -TypeName Veeam.Backup.Common.CCredentials -ArgumentList "lab\administrator","HisPass",0,0
PS C:\> $jobVSS.Credentials = $Credentials
PS C:\> $job | Set-VBRJobVssOptions -Options $jobVSS
After updating the object, I made a new query to get vss options and the VM's VSS credentials is set.
I'll test this function
jlsung
Influencer
Posts: 21 Liked: never
Joined: Sep 15, 2011 1:41 pm
Contact:
Post
by jlsung » Jan 04, 2012 5:00 pm
this post
It doesn't work, I had the same error.
I tested the same script in V6 and no issue
ThomasMc
Veteran
Posts: 293 Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:
Post
by ThomasMc » Jan 04, 2012 5:25 pm
this post
I've not got v5 to test now so I will have to leave you in the capable hands of Seth
Sethbartlett
Veteran
Posts: 282 Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:
Post
by Sethbartlett » Jan 04, 2012 9:20 pm
this post
Could you create a ticket and state that it needs to be assigned to me per this forum post and let me know the case # on here?
Skype:
Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @
sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
jlsung
Influencer
Posts: 21 Liked: never
Joined: Sep 15, 2011 1:41 pm
Contact:
Post
by jlsung » Jan 05, 2012 7:56 am
this post
@Thomas : Thanks
@Seth : #5164566
Users browsing this forum: No registered users and 11 guests