Hello!
I am trying to write a PowerCLI query to determine which VMs have VBS disabled and are also running the guest OS "Microsoft Windows Server 2016 or later (64-bit)".
I thought maybe something like this might work, but it's not returning anything:
Get-VM | sort | where { $vm.ExtensionData.config.flags.VbsEnabled -eq "False" -and $vm.ExtensionData.Guest.GuestFullName -eq "Microsoft Windows Server 2016 or later (64-bit)" } | Format-Table -AutoSize
Was I way off? I found another post here that details turning on VBS for a specific VM and it works great. That post also contains a command to check for a specific VM: (Get-VM myVM).extensiondata.config.flags.VbsEnabled but I am having such difficulty coming up with what seems like it should be a simple query.
Any help is greatly appreciated!