Using Find-VBRObject via PowerShell Remoting

PowerShell script exchange

Using Find-VBRObject via PowerShell Remoting

Veeam Logoby pizzim13 » Thu Jul 28, 2011 8:26 pm

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.
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Using Find-VBRObject via PowerShell Remoting

Veeam Logoby Gostev » Thu Jul 28, 2011 8:37 pm

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?
Gostev
Veeam Software
 
Posts: 21390
Liked: 2349 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Using Find-VBRObject via PowerShell Remoting

Veeam Logoby Sethbartlett » Thu Jul 28, 2011 11:39 pm

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.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Using Find-VBRObject via PowerShell Remoting

Veeam Logoby pizzim13 » Fri Jul 29, 2011 1:10 am

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.
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Using Find-VBRObject via PowerShell Remoting

Veeam Logoby Sethbartlett » Fri Jul 29, 2011 1:34 am

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.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Using Find-VBRObject via PowerShell Remoting

Veeam Logoby pizzim13 » Fri Jul 29, 2011 1:44 am

get-vbrserver remoting locally works without issue. I will open a ticket.
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Using Find-VBRObject via PowerShell Remoting

Veeam Logoby Sethbartlett » Fri Jul 29, 2011 5:14 pm

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.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Using Find-VBRObject via PowerShell Remoting

Veeam Logoby Andreas Neufert » Wed Aug 08, 2012 9:24 am

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
Veeam Software
 
Posts: 2201
Liked: 360 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

Re: Using Find-VBRObject via PowerShell Remoting

Veeam Logoby Andreas Neufert » Wed Aug 08, 2012 9:25 am

Andreas Neufert
Veeam Software
 
Posts: 2201
Liked: 360 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM


Return to PowerShell



Who is online

Users browsing this forum: Google [Bot] and 8 guests