PowerShell script exchange
Post Reply
jevao
Enthusiast
Posts: 29
Liked: 3 times
Joined: Oct 28, 2011 11:38 pm
Full Name: James Collison
Contact:

Find-VBRObject Failed to login

Post by jevao »

My “Find-VBRObject” command gets “Failed to login” message. The “user” it tries to login as is not in my Get-ViCredentialStoreItem file.
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
  
Here is run the connect-viserver command. Again, where does it get the user "dc\smith" and why does it fail?

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

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

Re: Find-VBRObject Failed to login

Post by veremin »

WARNING: This cmdlet is obsolete, use Find-VBRViEntity instead
The commendlet you're trying to use is obsolete and not supported any longer. So, can you try to switch to the mentioned alternative?
jevao
Enthusiast
Posts: 29
Liked: 3 times
Joined: Oct 28, 2011 11:38 pm
Full Name: James Collison
Contact:

Re: Find-VBRObject Failed to login

Post by jevao »

Thanks much for replying. I really appreciate it.

I thought that might be the problem also. But changing the command, I get the same error.

Code: Select all


PS C:> disconnect-viserver
disconnect-viserver : 7/23/2015 10:40:35 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], ViServerConnectionException
    + FullyQualifiedErrorId : Core_DisconnectVIServer_NotConnectedError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DisconnectVISer 
   ver
 

PS C:> Get-VBRServer -Name “vc.pf.com" | Find-VBRViEntity -VMsAndTemplates
Find-VBRViEntity : Failed to login to “vc.pf.com" by SOAP, port 443, user “dc\smith”, proxy srv: port:0
At line:1 char:48
+ Get-VBRServer -Name “vc.pf.com" | Find-VBRViEntity -VMsAndTemplates
+                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Find-VBRViEntity], Exception
    + FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Command.FindVBRViEntity
 

PS C:> disconnect-viserver
disconnect-viserver : 7/23/2015 10:41:00 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], ViServerConnectionException
    + FullyQualifiedErrorId : Core_DisconnectVIServer_NotConnectedError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DisconnectVISer 
   ver
 

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:> Get-VBRServer -Name “vc.pf.com" | Find-VBRViEntity -VMsAndTemplates
Find-VBRViEntity : Failed to login to “vc.pf.com" by SOAP, port 443, user “dc\smith”, proxy srv: port:0
At line:1 char:48
+ Get-VBRServer -Name “vc.pf.com" | Find-VBRViEntity -VMsAndTemplates
+                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Find-VBRViEntity], Exception
    + FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Command.FindVBRViEntity
 
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find-VBRObject Failed to login

Post by veremin »

Most likely, the given server is added into backup console under "dc\smith", thus, when you try reach it via VB&R PS snap-in the latter uses the very same credentials. Thanks.
jevao
Enthusiast
Posts: 29
Liked: 3 times
Joined: Oct 28, 2011 11:38 pm
Full Name: James Collison
Contact:

Re: Find-VBRObject Failed to login

Post by jevao »

Thanks again.
This is on a new test VM created to test Veeam powershell scripts before updating my production VM to Veeam 8.
The migration method used was to Backup the Veeam SQL database from production backup server,
install Veeam 7 on test VM and attach copy of prodution SQL database to it during install.
Just remembered, I am supposed to re-add the logins with this procedure, but have not done that.
I will do that now.
jevao
Enthusiast
Posts: 29
Liked: 3 times
Joined: Oct 28, 2011 11:38 pm
Full Name: James Collison
Contact:

Re: Find-VBRObject Failed to login

Post by jevao » 1 person likes this post

Thanks again.

That was the problem.
Passwords need to be reset when migrating the SQL database to new server.
Went into Manage Credentials and Edit each credential and reset password.
Works now.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find-VBRObject Failed to login

Post by veremin »

Yep, while trying to communicate with Vi servers, the commandlet takes credentials under which those entities are added to the backup console. So, once the right passwords had been specified, everything stared to work properly.

Anyway, glad to hear you've sorted it out.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests