Count of Physical, VMware, and MS Virtual computers

Declare @MS as int
Declare @VM as int
Declare @Real as int
Declare @Total as int

set @Total = (select count(*) from v_GS_COMPUTER_SYSTEM)
set @MS = (select count(*) from v_GS_COMPUTER_SYSTEM where Manufacturer0 = ‘Microsoft Corporation’ )
set @VM = (select count(*) from v_GS_COMPUTER_SYSTEM where Manufacturer0 = ‘VMware, Inc.’)
set @Real = (select @total – @MS – @VM)
Select
@Real as ‘Real PCs’,
@MS as ‘MS Virtual PCs’,
@VM as ‘VM Virtual PCs’,
@Total as ‘Total’

 

Leave a Reply

Your email address will not be published. Required fields are marked *