#!/usr/bin/perl -w # # Copyright 2006 VMware, Inc. All rights reserved. # # This script prints names of all VM's with Windows guest use strict; use warnings; use VMware::VIRuntime; # read/validate options and connect to the server Opts::parse(); Opts::validate(); Util::connect(); # find datacenter my $intype; $intype = "Datacenter"; my $datacenter_views = Vim::find_entity_views(view_type => 'Datacenter'); my $counter = 0; print "DataCenters found:\n"; foreach (@$datacenter_views) { print $_->name . "\n"; $counter++; } print "Total: $counter"; # disconnect from the server Util::disconnect();