Those Lazy SMS Properties!

 

Some of the object properties within SMS are lazy. To be more precise they are ‘Lazy Properties’. This simply means that the data exist but it is not exposed to the SMS Query builder or the SMS console. However it can be accessed using WMI or WbemTest.

 

As an example in the Sms_Advertisement class the AssignedSchedule and StartTime properties are lazy properties. Within the Sms_Pdf_Package the Icon property is an array containing icon data and it is also a lazy property.

 

As a rule the data is meaningless numeric data and therefore useless to you. And as I mentioned they can be accessed through various programming languages as well as a WMI class viewer.

 

Programmatically you can use the Get instance for the object to get the data as in the example below taken from the link at the bottom of this page.

 

Set colAdvertisements = objSWbemServices.ExecQuery("Select * From SMS_Advertisement")

 

For Each objAdvert In colAdvertisements

WScript.Echo "ActionInProgress = " & objAdvert.ActionInProgress

WScript.Echo "AdvertFlags = " & objAdvert.AdvertFlags

WScript.Echo "AdvertisementID = " & objAdvert.AdvertisementID

WScript.Echo "AdvertisementName = " & objAdvert.AdvertisementName

 

'For the lazy properties, get the advertisements individually.

Set lazyproperties = objSWbemServices.Get("SMS_Advertisement.AdvertisementID='" & ObjAdvert.advertisementid & "'")

WScript.Echo "Assigned Schedule = {"      

For i=0 to ubound(lazyproperties.assignedschedule,1)

 

WScript.Echo " instance of " & lazyproperties.Properties_("AssignedSchedule").Value(0).Path_.Class

WScript.Echo lazyproperties.Properties_("AssignedSchedule").Qualifiers_("CIMType")

WScript.Echo "   DayDuration: " & lazyproperties.AssignedSchedule(i).DayDuration

WScript.Echo "   Hourspan: " & lazyproperties.AssignedSchedule(i).HourSpan

WScript.Echo "   IsGMT: " & lazyproperties.AssignedSchedule(i).IsGMT

WScript.Echo "   StartTime: " & lazyproperties.AssignedSchedule(i).StartTime

WScript.Echo "AssignedScheduleEnabled = " & lazyproperties.AssignedScheduleEnabled

WScript.Echo "AssignedScheduleIsGMT = " & lazyproperties.AssignedScheduleIsGMT

 

Next

WScript.Echo "}"      

WScript.Echo "CollectionID = " & objAdvert.CollectionID

WScript.Echo "Comment = " & objAdvert.Comment

 

Next

  

How to Read Lazy Properties

http://www.microsoft.com/technet/prodtechnol/sms/sms2003/maintain/smsscript/script11.mspx?mfr=true

 

Published Friday, November 17, 2006 7:46 PM by dhite
Filed under:

Comments

# VBS Script To Export SMS Web Reports To Microsoft Word

This Vbs script will take an SMS site server name and site code from an input box and then enumerate

Tuesday, November 28, 2006 1:57 PM by Don Hite