Env with PC Info v2

select
  ENV.VariableValue0 AS ‘Val’
, ENV.ResourceID as ‘ResourceID’
into #Var
from
    v_GS_ENVIRONMENT ENV
where
ENV.Name0 = ‘QTJava’

select distinct
CS.Name0 AS ‘Computer Name’
, CS.UserName0 AS ‘Last Logged on User’
, CS.Domain0 AS ‘Domain’
, OS.Caption0 AS ‘Operating System’
, OS.csdversion0 AS ‘Service Pack Level’
, BIOS.serialnumber0 AS ‘Serial Number’
, CS.manufacturer0 AS ‘Manufacturer’
, CS.model0 AS ‘Model’
, RAM.totalphysicalmemory0 AS ‘Memory (KBytes)’
, CPU.maxclockspeed0 AS ‘Processor (GHz)’
, HD.size0 AS ‘Disk Space (MB)’
, HD.FreeSpace0 AS ‘Free Disk Space (MB)’
, #var.Val AS ‘Image Version’
from
v_GS_Computer_System CS
inner join v_GS_Operating_system OS on (OS.resourceid = CS.ResourceID)
inner join v_gs_PC_bios BIOS on (BIOS.resourceid = CS.ResourceID)
inner join v_gs_system_enclosure on (v_gs_system_enclosure.resourceid = CS.ResourceID)
inner join v_GS_x86_PC_memory RAM on (RAM.resourceid = CS.ResourceID)
inner join v_GS_processor CPU on (CPU.resourceid = CS.ResourceID)
inner join v_GS_LOGICAL_DISK HD on (HD.resourceid = CS.ResourceID)
left outer join #var on (#var.resourceid = CS.ResourceID)
where
HD.deviceID0 = ‘C:’
Order by  
CS.Name0

Drop table #var

Leave a Reply

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