Andys scripting corner - Find-VBRViEntity example / Find VM

PowerShell script exchange

Andys scripting corner - Find-VBRViEntity example / Find VM

Veeam Logoby Andreas Neufert » Tue Aug 07, 2012 12:01 pm 2 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: Select all
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
$vcenter = "" #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

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            :\demolab\demolab Cluster\Produktiv\ad
VmHostName      :
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
Andreas Neufert
Veeam Software
Posts: 2689
Liked: 455 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: No registered users and 11 guests