Edit

Share via


Advanced exercise 2: Create a new report for hardware inventory in Configuration Manager

In this exercise, you will create a Configuration Manager report that displays the computer name, site code, the date of the last scan for hardware inventory, and the number of days since the last scan for a specified computer.

Important

Before you begin this exercise, you should review the basic exercises to learn about the report elements, the properties for a report, and the different ways to create the report SQL statement.

Report requirements

Use the following report requirements to create the new report.

SQL Server views in the SQL statement

Use the following Configuration Manager SQL Server views when creating the report SQL statement:

JOINS in the SQL statement

Create the following JOINS in the SQL statement:

  • v_GS_WORKSTATION_STATUS is joined to v_R_System by using the ResourceID columns.
  • v_RA_System_SMSInstalledSites is joined to v_R_System by using the ResourceID columns.

Columns in the SQL statement

Use the following report columns, in the order listed:

  1. Netbios_Name0 AS [Computer Name] from v_R_System
  2. SMS_Installed_Sites0 AS [Site Code] from v_RA_System_SMSInstalledSites
  3. LastHWScan AS [Last HWScan] from v_GS_WORKSTATION_STATUS
  4. DATEDIFF(day, v_GS_WORKSTATION_STATUS.LastHWScan, GETDATE()) AS [Days Since Last HWScan]

Note

This report integrates two SQL Server functions to determine the difference between the last hardware scan date and the current date. To display this column, you can copy the whole line into the SQL statement, or you can copy DATEDIFF(day, v_GS_WORKSTATION_STATUS.LastHWScan, GETDATE()) into the Column column and Days Since Last HWScan into the Alias column in Query Designer.

Sort the data in descending order, using the LastHWScan column.

Filters in the SQL statement

The report SQL statement does not contain any filters.

Report prompts

The Configuration Manager report should contain a report prompt for the computer name that will be reported on.

Solution

See Advanced exercise 2 solution: Create a new report for hardware inventory in Configuration Manager for detailed information about how to create this report.

See also

Exercise 1: run an existing Configuration Manager report Advanced exercise 2 solution: Create a new report for hardware inventory in Configuration Manager