Thursday, October 15, 2015

Query Daylight Saving Time information with SCCM

Many system administrators regularly get asked about computers Daylight Saving Time (DST) information in there network.
With SCCM you can easily get that information with simple query and add it to collection.

First, to get time zone information we need to add Time Zone class to hardware inventory in the relevant client settings:
 

Soon as the clients will get the new policy and send hardware inventory to the server, we can start with the query.

Next step is to determine when DST will start\end. in this example, DST will end on October-25-15:


Create new collection with the following query:

Creation Type = Simple Value
Attribute class = Time Zone

Attributes:
  • Standard Day with value of 5 - the First, Second, Third, Fourth, or last day on month that the time changes (1 = First, 2 = Second.... 5 = Last).
  • Standard Day Of Week with value of 0 - the day of the week the time change will occur (0 = Sunday, 1 = Monday.... 6 = Saturday).
  • Time Zone Standard Month with value of 10 - the month the time change will occur (1 = January, 2 = February...)

 
Change each Operator to: is not equal to and set the desire value.
Change to OR between each criterion.
The result will be:


And the query:
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_TIME_ZONE on SMS_G_System_TIME_ZONE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_TIME_ZONE.StandardDay != 5 or SMS_G_System_TIME_ZONE.StandardDayOfWeek != 0 or SMS_G_System_TIME_ZONE.StandardMonth != 10

No comments:

Post a Comment