Jump to content


TH0MA5

Established Members
  • Posts

    1
  • Joined

  • Last visited

TH0MA5's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. TH0MA5

    Hardware age report

    Blaf, Are you looking for a query statement that provides you with the age of every computer in your company or are you looking for a report to tell you a number of how many computers needs to be replaced this year? My company is moving to a 3 year hardware refresh and I am using SCCM to run a query statement that pulls the BIOS date from our computers and we use that data to determine what computers need to be replaced that year. I am not a SQL or SCCM expert but this is what I do: Open Microsoft SQL Server Report Builder, click on the circle in the top left and select: New Report Select Table or Matrix Wizard Select Create a dataset and click Next Select your Data Source Connection (you might need to enter your credentials) and click Next On the Design a query page, select Edit as Text and copy the following SQL code into the blank white box: SELECT distinct CS.name0 as 'Computer Name', CS.domain0 as 'Domain', CS.UserName0 as 'User', OS.Description0 as 'Description', BIOS.SerialNumber0 as 'Bios serial', BIOS.ReleaseDate0 as 'Bios Date', CS.Manufacturer0 as 'Manufacturer', CS.Model0 as 'model', OS.Caption0 as 'OS', RAA.SMS_Assigned_Sites0 as 'Site', RAM.TotalPhysicalMemory0 as 'Total Memory', sum(isnull(LDisk.Size0,'0')) as 'Hardrive Size', sum(isnull(LDisk.FreeSpace0,'0')) AS 'Free Space', Processor.MaxClockSpeed0 as 'CPU Speed' from v_GS_COMPUTER_SYSTEM CS right join v_GS_PC_BIOS BIOS on BIOS.ResourceID = CS.ResourceID right join v_GS_SYSTEM SYS on SYS.ResourceID = CS.ResourceID right join v_GS_OPERATING_SYSTEM OS on OS.ResourceID = CS.ResourceID right join v_RA_System_SMSAssignedSites RAA on RAA.ResourceID = CS.ResourceID right join V_GS_X86_PC_MEMORY RAM on RAM.ResourceID = CS.ResourceID right join v_GS_Logical_Disk LDisk on LDisk.ResourceID = CS.ResourceID JOIN v_GS_PROCESSOR Processor on SYS.ResourceID=Processor.ResourceID right join v_GS_SYSTEM_ENCLOSURE SE on SE.ResourceID = CS.ResourceID where LDisk.DriveType0 =3 group by CS.Name0, CS.domain0, CS.Username0, BIOS.SerialNumber0, CS.Manufacturer0, CS.Model0, OS.Caption0, RAA.SMS_Assigned_Sites0, RAM.TotalPhysicalMemory0, Processor.MaxClockSpeed0, BIOS.ReleaseDate0, OS.Description0 Click on the Red ! to run a test and see if this line of code works in your environment. If it runs click Next. Drag all the desired items from the Available Fields to Values box and click next (You might be able to add something to the Row group to sort by the year but I'm not sure) If you don't have anything in the Row Group, just click Next Select a style that you like and click Finish. Edit the form as you desire Every environment is different and you will most likely have to edit the SQL statement to fit what you need, but hopefully this will point you in the right direction. TH0MA5
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.