I am logged in as user “dc\veeam”.
I am not looged in as user “dc\smith” which it is trying to use, and user “DC\smith” is not in the credentials file.
Why is “Find-VBRObject” not using Get-ViCredentialStoreItem and where is it getting the user “dc\smith” it is trying to login as.
Here I run the command without running connect-viserver command. Where does it get the user "dc\smith" and why does it fail?
Code: Select all
PS C:> disconnect-viserver
disconnect-viserver : 7/23/2015 8:18:06 AM Disconnect-VIServer PowerCLI is currently
not connected to a server. To create a new connection use Connect-VIServer.
At line:1 char:1
+ disconnect-viserver
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Disconnect-VIServer], ViServerConnectionExce
ption
+ FullyQualifiedErrorId : Core_DisconnectVIServer_NotConnectedError,VMware.VimAutomation.ViCo
re.Cmdlets.Commands.DisconnectVIServer
PS C:> $VCenter = “vc.pf.com"
PS C:> $vbrserverVC = Get-VBRServer | where {$_.Name -eq $VCenter}
PS C:> $vbrserverVC
Info : vc.pf.com
ParentId :
Id :
Name : vc.pf.com
RealName : vc.pf.com
Reference :
Description : Created by DC\veeam at 3/5/2012 12:39:48 PM.
IsUnavailable : False
Type : VC
ApiVersion : V55
PhysHostId :
ProxyServicesCreds :
PS C:> $VM=“vc06012015"
PS C:> $vbrobjects = Find-VBRObject $vbrserverVC | ?{$_.name -eq $VM}
WARNING: This cmdlet is obsolete, use Find-VBRViEntity instead
Find-VBRObject : Failed to login to “vc.pf.com" by SOAP, port 443, user
"dc\smith”, proxy srv: port:0
At line:1 char:15
+ $vbrobjects = Find-VBRObject $vbrserverVC | ?{$_.name -eq $VM}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Find-VBRObject], Exception
+ FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Command.FindVBRObject
Code: Select all
PS C:> $sdir = "c:\users\veeam\credstore"
PS C:> $credential = Get-VICredentialStoreItem -Host vc.pf.com -File $sdir
PS C:> connect-viserver -server vc.pf.com -User $credential.user -password $credential.password
Name Port User
---- ---- ----
vc.pf.com 443 DC\veeam
PS C:> $VCenter = “vc.pf.com"
PS C:> $vbrserverVC = Get-VBRServer | where {$_.Name -eq $VCenter}
PS C:> $vbrserverVC
Info :vc.pf.com
ParentId :
Id :
Name : vc.pf.com
RealName : vc.pf.com
Reference :
Description : Created by DC\veeam at 3/5/2012 12:39:48 PM.
IsUnavailable : False
Type : VC
ApiVersion : V55
PhysHostId :
ProxyServicesCreds :
PS C:> $vbrobjects = Find-VBRObject $vbrserverVC | ?{$_.name -eq $VM}
WARNING: This cmdlet is obsolete, use Find-VBRViEntity instead
Find-VBRObject : Failed to login to “vc.pf.com" by SOAP, port 443, user "dc\smith”, proxy srv: port:0
At line:1 char:15
+ $vbrobjects = Find-VBRObject $vbrserverVC | ?{$_.name -eq $VM}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Find-VBRObject], Exception
+ FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Command.FindVBRObject