VMware Cloud Community
MROUSHDY84
Contributor
Contributor
Jump to solution

Get VMs with 3D enabled

Hello,

I need to make sure that the 3D acceleration is disabled on all VMs, but this script didn't work for me. I'm using PowerCLi v10

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}

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Works for me.

Are you sure you have a VM that has "Enable 3D Support" ticked?

Check what all VMs have with

Get-View -ViewType VirtualMachine -Property Name,Config.Hardware.Device |

ForEach-Object {

  $vm = $_

  $vm.Config.Hardware.Device |

  Where-Object {$_ -is [VMware.Vim.VirtualMachineVideoCard]} |

  Select-Object -property @{N="VM";E={$vm.Name}},Enable3DSupport

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Works for me.

Are you sure you have a VM that has "Enable 3D Support" ticked?

Check what all VMs have with

Get-View -ViewType VirtualMachine -Property Name,Config.Hardware.Device |

ForEach-Object {

  $vm = $_

  $vm.Config.Hardware.Device |

  Where-Object {$_ -is [VMware.Vim.VirtualMachineVideoCard]} |

  Select-Object -property @{N="VM";E={$vm.Name}},Enable3DSupport

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
MROUSHDY84
Contributor
Contributor
Jump to solution

What you are saying is reasonable, it returned nothing as non is enabled, I just wanted to make sure that nothing is enabled.

Thanks.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

To be absolutely sure, create a test VM with 3D enabled :smileycool:


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

MROUSHDY84
Contributor
Contributor
Jump to solution

Yeah, I've tried that and it did the trick.

Thanks,

0 Kudos