VMware Cloud Community
dkohl79
Contributor
Contributor

Find VMs with 3D graphics enabled?

Does anyone know of a powercli script to find all VMs with the 3D graphics setting enabled?3D graphics setting.jpg

6 Replies
RvdNieuwendijk
Leadership
Leadership

The following PowerCLI script will give you a list of all your VM's and templates and shows if 3D support is enabled or disabled:

Get-View -ViewType VirtualMachine -Property Name,Config.Hardware.Device | `
  ForEach-Object {
    $VM = $_
    $VM.Config.Hardware.Device | `
    Where-Object {$_.GetType().Name -eq "VirtualMachineVideoCard"} | `
    Select-Object -property @{N="VM";E={$VM.Name}},Enable3DSupport
  }


If you want to see only the VM's and templates with 3D support enabled you can filter the output:

Get-View -ViewType VirtualMachine -Property Name,Config.Hardware.Device | `
  ForEach-Object {
    $VM = $_
    $VM.Config.Hardware.Device | `
    Where-Object {$_.GetType().Name -eq "VirtualMachineVideoCard"} | `
    Select-Object -property @{N="VM";E={$VM.Name}},Enable3DSupport
  } | Where-Object {$_.Enable3DSupport}


If you want only VM's and no templates you need to change the first line into:

Get-View -ViewType VirtualMachine -Filter @{"Config.Template"="False"} -Property Name,Config.Hardware.Device | `

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
dkohl79
Contributor
Contributor

Worked like a charm.  Thanks for your assistance Robert

Regards,

aprimo Integrated Marketing Software

A Teradata Company

Derick Kohl | Systems Administrator, Cloud Services

Reply
0 Kudos
htwnrver
Enthusiast
Enthusiast

Thanks! Is there anyway to mass uncheck that box without power downs via powercli?

Reply
0 Kudos
monderick
Enthusiast
Enthusiast

We noticed several VM's across out environment have the Enable3DSupport flag enabled.  Has anyone been able to disable this via powercli?

We use a nice LucD script for changing the Video Memory to autodetect, so hoping it's possible.

thanks.

Reply
0 Kudos
vMcRon201110141
Contributor
Contributor

You ROCK!

Thanks for the help.

Reply
0 Kudos
weda
Enthusiast
Enthusiast

In this context, I'm looking for a script that enables 3D support on the VM, without editing the vmx file. That would be very great.
         

Reply
0 Kudos