Reporting
Hello,
Does anyone have a template or could provide a query to create a report of all scheduled advertisements, by date or range of dates?
Thank you for your help.
Does anyone have a template or could provide a query to create a report of all scheduled advertisements, by date or range of dates?
Thank you for your help.
0 Comments
[ + ] Show comments
Answers (9)
Please log in to answer
Posted by:
GillySpy
12 years ago
Yes, but you would have to tell it what you want to know about.
Three obvious options: 1>Option A1>: using the built-in alerts:
[ol][*]Reporting->email alerts->add new computer notification[*]choose a threshold the wizard can handle[*]you will now get a notification when a machine meets that criteria on its checkin
[/ol]1>Option B1>: extend the notification to use a custom query -- this time on ASSET HISTORY
Look at the asset history of a machine. Whatever is in that you could report on.
[ol][*]open the notification you created above (reports->email alerts->click on existing one)
[*]change the query to something like below
[/ol]E.g.
[code]
Select MACHINE.ID
from MACHINE
join ASSET A on MAPPED_ID=MACHINE.ID and ASSET_TYPE_ID=5
join ASSET_HISTORY AH on AH.ASSET_ID=A.ID
where
AH.DESCRIPTION like '%ram change%' -- note that i do not know what this would be for RAM
and AH.TIME > date_sub(now(), interval 1 DAY)[/code]
1>Option C1>: run a scheduled report so you get the alert on many machines at one time (e.g. daily ). Benefit of this is you can choose which columns to return including the asset history
[ol][*]Reporting->add new sql report[*]use this SQL (note the SQL here is almost same as above but you can tweak it)
[/ol][code]Select MACHINE.ID, MACHINE.NAME,
AH.DESCRIPTION -- description can be lengthy so you might want to substring it, etc
from MACHINE
join ASSET A on MAPPED_ID=MACHINE.ID and ASSET_TYPE_ID=5
join ASSET_HISTORY AH on AH.ASSET_ID=A.ID
where
AH.DESCRIPTION like '%ram change%' -- note that i do not know what this would be for RAM
and AH.TIME > date_sub(now(), interval 1 DAY)[/code]
A Less obvious option would be automatically creating a ticket when a threshold is exceeded and leveraging all the benefits that go with that (emails, audit trail, etc). The basic idea is that you could have your alert above send the ticket to the queue. see http://www.kace.com/support/kb/index.php?action=artikel&cat=8&id=719&artlang=en in step 3.2 you would use a query like the above. Inour helpdesk we get notifications from the system into our queue that tell us about certain things like the status of last nights maintenance run.
Three obvious options: 1>Option A1>: using the built-in alerts:
[ol][*]Reporting->email alerts->add new computer notification[*]choose a threshold the wizard can handle[*]you will now get a notification when a machine meets that criteria on its checkin
[/ol]1>Option B1>: extend the notification to use a custom query -- this time on ASSET HISTORY
Look at the asset history of a machine. Whatever is in that you could report on.
[ol][*]open the notification you created above (reports->email alerts->click on existing one)
[*]change the query to something like below
[/ol]E.g.
[code]
Select MACHINE.ID
from MACHINE
join ASSET A on MAPPED_ID=MACHINE.ID and ASSET_TYPE_ID=5
join ASSET_HISTORY AH on AH.ASSET_ID=A.ID
where
AH.DESCRIPTION like '%ram change%' -- note that i do not know what this would be for RAM
and AH.TIME > date_sub(now(), interval 1 DAY)[/code]
1>Option C1>: run a scheduled report so you get the alert on many machines at one time (e.g. daily ). Benefit of this is you can choose which columns to return including the asset history
[ol][*]Reporting->add new sql report[*]use this SQL (note the SQL here is almost same as above but you can tweak it)
[/ol][code]Select MACHINE.ID, MACHINE.NAME,
AH.DESCRIPTION -- description can be lengthy so you might want to substring it, etc
from MACHINE
join ASSET A on MAPPED_ID=MACHINE.ID and ASSET_TYPE_ID=5
join ASSET_HISTORY AH on AH.ASSET_ID=A.ID
where
AH.DESCRIPTION like '%ram change%' -- note that i do not know what this would be for RAM
and AH.TIME > date_sub(now(), interval 1 DAY)[/code]
A Less obvious option would be automatically creating a ticket when a threshold is exceeded and leveraging all the benefits that go with that (emails, audit trail, etc). The basic idea is that you could have your alert above send the ticket to the queue. see http://www.kace.com/support/kb/index.php?action=artikel&cat=8&id=719&artlang=en in step 3.2 you would use a query like the above. Inour helpdesk we get notifications from the system into our queue that tell us about certain things like the status of last nights maintenance run.
Posted by:
tdurning
7 years ago
I know this is old, but I wrote some functions to decode the SMS_ScheduleToken so the deadlines can be displayed in SQL Reports.
https://sccmnotes.wordpress.com/2017/06/13/decoding-the-sms_scheduletoken-in-t-sql/
Posted by:
tdurning
7 years ago
I know this is old, but I created a SQL function that decodes the SMS_ScheduledToken for use in reporting.
https://sccmnotes.wordpress.com/2017/06/13/decoding-the-sms_scheduletoken-in-t-sql/
Posted by:
Jsaylor
14 years ago
The below SQL will pull all advertisements on your SCCM site, and sort them by the advertisement start time. If you're familiar with the database at all, there are a few other columns you can add into the query under v_advertisement, but I believe I hit the ones you'll care about.
Select adv.advertisementname "Advertisement Name", adv.advertisementID "Advertisement ID", adv.programname "Program name", adv.presenttime "Advertisement Start time" from
v_Advertisement Adv
order by adv.presenttime
Posted by:
august606
14 years ago
Posted by:
Jsaylor
14 years ago
Unfortunately, the mandatory assignment dates aren't stored in a way that is really human-readable. They're stored as "schedule tokens" that look something like: 9149B9C000080000
There's a way to decode them, but it's not something you could get running in a web report. You would have to use a WMI call to decode the information with the SMS_Scheduletoken class, here's the official explanation page. If you're interested in looking at the raw data, check out dbo.programoffers in your database, in column MandatorySched.
There's a way to decode them, but it's not something you could get running in a web report. You would have to use a WMI call to decode the information with the SMS_Scheduletoken class, here's the official explanation page. If you're interested in looking at the raw data, check out dbo.programoffers in your database, in column MandatorySched.
Posted by:
mac456
12 years ago
Posted by:
mac456
12 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.