Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 179681

Find Flexible Adapters ?

$
0
0

Hi Guys,

 

Can someone help me modify this script to find all VM's with flexible adapters regardless of the Tools Status?

 

If it could display the OS type too that would be great.

 

# Get all VM objects

$vms = get-view -viewtype virtualmachine

 

# Set up an empty array

$table = @()

 

# For Every Vm...

Foreach ($vm in $vms)

{

    # If Tools aren't installed and there is a PCNet32 adapter in the hardware list...

    if ($vm.guest.toolsstatus -eq "toolsNotInstalled" -and (($vm.config.hardware.device | %{$_ -is [VMware.Vim.VirtualPCNet32]}) -contains $true))

    {

        # Then output it to an object and add it to the array

        $table += New-Object PSObject -Property @{"Name"=$vm.name; "ToolsStatus"=$vm.guest.toolsstatus; "NicType"="Flexible"}

    }

}

 

# Output the table. You can Export to a CSV or whatever here.

$table


Viewing all articles
Browse latest Browse all 179681

Trending Articles