In this article, I will demonstrate how to query time zone inventory using SCCM (ConfigMgr). We will go through the steps to get the Time Zone information from clients and servers using a query in ConfigMgr.
Many Configuration Manager administrators regularly get asked about computers Daylight Saving Time (DST) information in their network. With Configuration Manager, you can easily get that information with simple query and add it to collection.
Before you can query the Time Zone information on all clients or servers, you will require enabling the hardware inventory class for time zone. Refer to the guide on how to enable hardware inventory in SCCM. Once that is enabled, you can easily query Daylight Saving Time information with SCCM using a simple query and add it to collection.
A time zone is a geographical region in which the same time is used. This data can be obtained from the Windows registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. For more information on Time Zone object, read this article.
Steps to Query Time Zone Inventory using SCCM
Let’s go through the steps to query the time zone inventory using SCCM.
Step 1: Enable Win32_TimeZone Hardware Inventory Class
When you turn on the Hardware Inventory feature, only then can the Configuration Manager query clients and servers about their time zones. However, by default, ConfigMgr doesn’t do that. Therefore, you have to enable a new Hardware Inventory class named “Time Zone(Win32_TimeZone)” with the following steps:
- Launch the Configuration Manager console.
- Go Administration > Overview > Client Settings.
- Right-click the Default Client Settings and select Properties.
- In the Hardware Inventory tab, click Set Classes.
In the search bar, type “timezone,” and from the search results, select the Time Zone (Win32_TimeZone) hardware inventory class. There are different classes available under Win32_TimeZone, and you may select a few or all of them depending on your requirements. Once you have selected the classes, click OK.
Step 2: Trigger Hardware Inventory via Client Notification
After you have configured the hardware inventory for time zone, you can either wait for the hardware inventory to be collected from the client computers or manually trigger the hardware inventory using client notification.
By default, the client will update the new policies every 60 minutes. To expedite things, go to Assets and Compliance > Device Collections. Right-click “All Desktop and Server Clients” and select Client Notification > Download Computer Policy. Repeat the procedure for the Collect Hardware Inventory client notification.
You can monitor policy evaluations under Monitoring > Overview > Client Operations. From the screenshot below, we see “Collect Hardware Inventory” and “Download Computer Policy” have been executed successfully on the client computers.
To track if the clients are sending the hardware inventory information to the SCCM server, you can review the InventoryAgent.log file on individual client computers. If the inventoryagent.log file contains the line “Inventory: Action completed,” it means the hardware inventory is successful on the client computers.
Step 3: Create SCCM Time Zone Query
In this step, we will create a new query in SCCM that will query time zone information on clients and servers. Use the following steps to create a new SCCM time zone query.
Launch the ConfigMgr console and navigate to Monitoring Workspace. Under Monitoring, select Queries, right-click Queries and select Create Query.
On the General tab of the Create Query Wizard, specify the name of the query as “TimeZone Query” or something similar, and select Edit Query Statement.
On the query statement properties window, select the General tab. At the bottom, click Show Query Language.
On the Query Statement Properties window, copy and paste the below query. Click OK. Complete the remaining steps and close the Create Query wizard. That completes the steps to create a time zone query in SCCM.
Select SMS_R_System.Name, SMS_G_System_TIME_ZONE.* from SMS_R_System inner join SMS_G_System_TIME_ZONE on SMS_G_System_TIME_ZONE.ResourceID = SMS_R_System.ResourceId
Step 4: Run the Time Zone Query
In the previous step, we created a time zone query in Configuration Manager. In this step, we will run the query to find out the time zone information on the clients. To run the query, under Queries, right-click the TimeZone query and select Run. The query output includes the time zone information of the client computers.
The following details are shown in the ConfigMgr console when you run the time zone query:
- System Resource Name
- Time Zone Caption
- Time Zone Daylight Name
- Time Zone Bias
- Time Zone Daylight Bias
- Time Zone Daylight Day
- Time Zone Daylight
Furthermore, the TimeZone.DaylightBias value is stored as part of the value for TZI for that time zone in the Windows registry. In relation to the UTC time and the local time of the time zone, UTC time is the result of adding the bias and daylightbias to the local time. For example, in a state adopting daylight time in the Pacific time zone, the Bias is 480 minutes and DaylightBias is -60 minutes.
To determine the time in UTC for June 11, 2 A.M. PST, add a Bias of (480/60) hours and a DaylightBias of -(60/60) hours to the local time June 11, 2 A.M. The time in UTC is June 11, 9 A.M.