SQL Code used in SCCM Reporting to get list of Advertisements that are Mandatory! select adv.AdvertisementName as [Adv Name], adv.PresentTime as DistributionDate, pkg.Name as PackageName, pgm.ProgramName, coll.Name as CollectioName, adv.AdvertisementID from v_Advertisement adv join v_Package pkg on adv.PackageID=pkg.PackageID join v_Program pgm on adv.PackageID=pgm.PackageID and adv.ProgramName=pgm.ProgramName join v_Collection coll on adv.CollectionID=coll.CollectionID join v_ClientAdvertisementStatus stat on adv.AdvertisementID=stat.AdvertisementID…

The way SCCM Configmgr 2012 object information stored is changed from CM07 with respect to tables/views. In SCCM Configmgr 2012,Status of content stored in dbo.vSMS_DistributionDPStatus view.This view basically contains information about packageID,content status,objectTypeID like what type of package is it(boot image or package/Application etc) and status message ID. These status Message IDs and State Message…