PowerShell script exchange
Post Reply
Andreas Neufert
VP, Product Management
Posts: 4361
Liked: 815 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Andys scripting corner - Find-VBRViEntity example / Find VM

Post by Andreas Neufert » 3 people like this post

Find-VBRViEntity example

Connect to vcenter and search for a VM example

Compatible with 6.1 (older version not tested till now - please send feedback if you tried this script on v6.0 or v5)

Code

Code: Select all

Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
$vcenter = "vcenter.demolab.an.veeam.de" #Your Hostname or IP Address of ESX(i) or VCenter (see B&R console for correct name)
$searchstring = "AD"  #Search String. Here as example VM AD
$vcenterobject = Get-VBRServer -Name $vcenter
$searchobject = Find-VBRViEntity -Server $vcenterobject  -Name $searchstring
$ViObject
Example output

Code: Select all

ConnHost        : Veeam.Backup.Core.CHost
Type            : Vm
Reference       : vm-2682
Id              : 855c1b45-53ae-4fb0-8645-8d18d33bd9de_vm-2682
Name            : ad
Path            : vcenter.demolab.an.veeam.de\demolab\demolab Cluster\Produktiv\ad
VmHostName      : esx5-1.demolab.an.veeam.de
VmFolderName    : vm
FaultTolerance  : False
GuestInfo       : Veeam.Backup.Model.CGuestInfo
Uuid            : 422897e7-d5ec-d175-7d00-ff28b0668d0f
PowerState      : PoweredOn
IsTemplate      : False
ProvisionedSize : 44071419921
UsedSize        : 2890694673
CU Andy

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests