Symantec Management Platform (Notification Server)

 View Only
Expand all | Collapse all

SQL Query to include computer type ie. workstation, laptops, etc.

  • 1.  SQL Query to include computer type ie. workstation, laptops, etc.

    Posted Feb 10, 2012 12:34 PM

    I currently have a query that gives computer name, Assest owner, Application Name, App Version and Publisher but I need to include computer type ie. workstation, laptop, etc.

     

    I found the vcomputertype table but I cant figure out what to join on.

     

    i would appricate any help.

     

    Thanks!

     

    select

     

    DISTINCT

    c.Name,

    o.[User Name],

    a.DisplayName [Application Name],

    a.DisplayVersion,

    a.Publisher

    from vComputer c

    left join Inv_AddRemoveProgram a

     on a._ResourceGuid = c.Guid

    left join vAssetUserOwner o

     on o._AssetGuid = c.Guid

    WHERE a.DisplayName LIKE '%adobe acrobat%'



  • 2.  RE: SQL Query to include computer type ie. workstation, laptops, etc.
    Best Answer

    Posted Feb 10, 2012 01:24 PM

    There are two ways to do this.  You can do a CASE WHEN based on Chassis Type, or you can do a CASE WHEN based on Computer Model.

    If you do Model, it's something like this

    SELECT vc.Name,
    vc.[OS Name],
    vc.[OS Revision],
    hwcs.[Model],
    'Computer Type' = CASE
      WHEN hwcs.[Model] LIKE 'Optiplex%' THEN 'Desktop'
      WHEN hwcs.[Model] LIKE 'Latitude%' THEN 'Laptop'
      WHEN hwcs.[Model] LIKE 'Precision%' THEN 'Laptop'
      WHEN hwcs.[Model] = 'HP EliteBook 2740p' THEN 'Tablet'
      WHEN hwcs.[Model] IN ('3039W6H','64781VU','8143W9V') THEN 'Laptop'
    ELSE 'Unknown'
    END
    FROM vComputer vc
    JOIN vHWComputerSystem hwcs ON vc.Guid=hwcs._ResourceGuid
    WHERE hwc.[Model]<>'VMWare Virtual Platform'

    If you do Chassis Package Type, replace hwcs. with hwc. and change your JOIN to use vHWChassis hwc ON vc.Guid=hwc._ResourceGuid.  Then use [Chassis Package Type] instead of [Model], and CASE WHEN the numbers into the words you want to use.

    Many threads explain what these numbers mean in words.  You can use the words or make your own:

    https://www-secure.symantec.com/connect/articles/creating-hardware-chassis-type-view

    Does this help? SQL was entered straight into Connect, I hope it validates.



  • 3.  RE: SQL Query to include computer type ie. workstation, laptops, etc.

    Posted Feb 10, 2012 04:04 PM

    Thanks that helped!