PowerShell script exchange
Post Reply
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Using Find-VBRObject via PowerShell Remoting

Post by pizzim13 »

When I run the following locally on my Veeam server

Code: Select all

$VBRServerVC = Get-VBRServer | Where {$_.Type -eq "VC"}
Find-VBRObject -Server $VBRServerVC | where {$_.parent.type -eq "HostSystem"}
It properly returns a list of VM's in vCenter. But when I run the same code via PowerShell remoting I recieve:

Code: Select all

[veeam.local.com]: PS C:\Users\User\Documents> Find-VBRObject -Server $VBRServerVC | where {$_.parent.type -eq "HostSystem"}
Find-VBRObject : Failed to login to "vcenter.local.com" by SOAP, port 443, user ""domain"\"user"", proxy srv: port:0
At line:1 char:15
+ Find-VBRObject <<<<  -Server $VBRServerVC # | where {$_.parent.type -eq "HostSystem"}
    + CategoryInfo          : InvalidOperation: (Veeam.Backup.Po...d.FindVBRObject:FindVBRObject) [Find-VBRObject], CommonException
    + FullyQualifiedErrorId : Backup,Veeam.Backup.PowerShell.Command.FindVBRObject
Where "domain" & "user" are my domain and account name.
Gostev
Chief Product Officer
Posts: 31836
Liked: 7328 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Using Find-VBRObject via PowerShell Remoting

Post by Gostev »

I believe there are some PowerShell security settings that must be adjusted for remote execution... try digging in that direction maybe. Unless someone else can chime in with the solution?
Sethbartlett
Veteran
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Using Find-VBRObject via PowerShell Remoting

Post by Sethbartlett »

That is very odd and should work. Out of curiosity, what is the # sign in "-Server $VBRServerVC # | where {$_.parent.type -eq "HostSystem"}" ? I am getting you made sure to set the Veeam box to Set-ExecutionPolicy RemoteSigned correct? It also looks like you have remoting working properly so everything should be working on the powershell permissions. Another quick thing to try is remoting into the Veeam box, from the Veeam box. So Enter-PSSession veeambox and then try doing it. This will give you the "remote" affect, but locally.

Also, can the box you are on ping your VC by its FQDN and IP?
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.
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Re: Using Find-VBRObject via PowerShell Remoting

Post by pizzim13 »

The # was accidentally pasted in from when I was troubleshooting. Also for troubleshooting purposes the execution policy is set to unrestricted. Entering a remote session on the local Veeam server to itself returns the same error, but running outside of the session works fine. I can ping the VC without issue. Also, running cmdlets such as get-vbrjob remotely work without issue.
Sethbartlett
Veteran
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Using Find-VBRObject via PowerShell Remoting

Post by Sethbartlett »

Are you unable to do just Get-VBRServer when remoting locally? This is very odd behavior. Could you please make a ticket and let us know what the ticket # is so I can assist you further that way.
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.
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Re: Using Find-VBRObject via PowerShell Remoting

Post by pizzim13 »

get-vbrserver remoting locally works without issue. I will open a ticket.
Sethbartlett
Veteran
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Using Find-VBRObject via PowerShell Remoting

Post by Sethbartlett »

A solution to this issue was increasing the memory for remoting:

Code: Select all

set-item wsman:localhost\Shell\MaxMemoryPerShellMB 512
You can raise the number higher as needed, but 150 MB is the default for remote powershell sessions. The issue was that pizzim13 had a huge amount of VMs and not enough memory to process it.
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.
Andreas Neufert
VP, Product Management
Posts: 7098
Liked: 1517 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Using Find-VBRObject via PowerShell Remoting

Post by Andreas Neufert »

Thank you Seth,

great job.
It was hard to find over our Forum Search. But Tom found it for me.
Here are some search strings to better find it in our search:

Failed to login
port 443
Remote Powershell
vcenter

Failed to login to "vcenter.demolab.an.veeam.de" by SOAP, port 443, user "vcenter\Administrator", proxy srv: port:0
+ CategoryInfo : InvalidOperation: (Veeam.Backup.Po...FindVBRViEntity:FindVBRViEntity) [Find-VBRViEntity], Exception
+ FullyQualifiedErrorId : Backup,Veeam.Backup.PowerShell.Command.FindVBRViEntity
Andreas Neufert
VP, Product Management
Posts: 7098
Liked: 1517 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Using Find-VBRObject via PowerShell Remoting

Post by Andreas Neufert »

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests