Knowing what your Windows Media Center is up to from anywhere!
Are you like me and you stubbornly refuse to let go of your Windows Media Center? Would you like an easy way to open a mobile application and quickly see what’s going on with your media center? If so, this solution was made for you! This solution provides information on:
- What shows did the Media Center record?
- What shows have been deleted from the Media Center?
- How much free space is left… and more!
- All accessible from a website or your mobile device including push notifications when alerts occur.
In a previous blog posts related to Windows Media Center I have covered several relevant topics including:
- Fun with OMS and Windows Media Center
- How to create a Management Pack for Windows Media Center in System Center Operations Manager
- You can have my Windows Media PC when you pry it from my cold dead system
- Workaround for no television guide available in Windows Media Center after July 20th 2015
This blog post will provide information on the following topics:
- How to get started with Microsoft OMS
- How to gather the information needed for this solution into Microsoft OMS
- Where to download the solution for Microsoft OMS
- What does the solution look like?
- How to create custom fields in Microsoft OMS from information in your events logs
How to get started with Microsoft OMS
To get OMS go to http://www.microsoft.com/oms and click on the option to try for free.
Once you have created the workspace, deploy the agent to your Windows Media Center system from under Settings / Connected Sources / Windows Servers / Download Windows Agent (64 bit).
How to gather the information needed for this solution into Microsoft OMS
There are two types of data that we need to collect for this solution. The first is the events in the “media center” event log. The second is performance counters which indicate the free space for the Windows Media center system.
To collect the event logs:
On settings/data, add the Windows Event log named “Media Center” to the list of data to be collected.
And save this using the save button in the top left corner.
Once these events have started to collect, we can use a query such as this to find events which are occurring related to the Media Center log using syntax such as: (please note, this takes a few minutes to start and you may want to generate some new events in your Windows Media Center environment to get some data as it collects the log files going forward, not what was there historically)
Type=Event “Media Center”
To collect the performance counters:
This solution uses two performance counters to show the amount of free space on drives which store media center recordings. These are:
- LogicalDisk(%)\% Free Space
- LogicalDisk(%)\Free Megabytes
These counters are added under Settings / Data / Windows Performance counters. (Note: if you are already using the Server and Workstation Performance solution and added the counters for it, these are a subset of the counters required for that solution so you do not need to add anything else here).
Where to download the solution for Microsoft OMS
This solution is available for download on TechNet Galleries at: https://gallery.technet.microsoft.com/Windows-Media-Center-215da620. To add this solution, open the View Designer and point to the solution file downloaded from TechNet Galleries.
What does the solution look like?
The solution provides a top level view which shows recent recordings.
(Hint: once your drill down use the button on the top right side to show more data than a single day if needed).
Drilling into this view shows the recent history of recorded shows, free disk space on the drives that are visible to OMS (second hint, change the “% Free space on recording drive” to point to the disk where you store your recordings), and the recordings which were manually deleted.
Additionally, there is a check for program guide updates (this is still under development), and a list of several queries used by this solution.
These same views are also available on mobile devices. The examples below are from an iPad:
You can also configure notifications to alert you when alerts occur.
NOTE: To receive notifications you need to send alerts from OMS. For examples of alerts to send from OMS related to Windows Media Center see this blog post: Fun with OMS and Windows Media Center.
Using Custom fields in OMS:
This solution uses the custom field functionality which is available in OMS to make some of the visualizations more intuitive. As an example, if we want to know how many iterations of Star Trek have been recorded we need to extract that information from the event because the name of the series is not a separate field in the event log.
To turn on Custom Logs, we need to enable this under settings / Preview Features / Custom Logs as shown below.
To extract a custom field we start with running a query over several weeks of data if possible. Highlight the field in question and choose Extract Fields From Event.
Highlight the relevant text and give it a name:
Samples appear on the right columns.
When you have it working like you need it to then save the extraction in the bottom right:
Note: this field will not appear until after new records have been captured! They will appear under Settings / Data / Custom Fields.
For this solution we are using three custom fields (note how they end with a _CF which makes them easy to differentiate)
Once we have these custom fields defined correctly, we use these in several of the queries for this solution. These are:
- Tile view: Type=Event EventLog=”Media Center” (EventLevel=4) (Source=Recording) ” started recording on ” | measure count() by ShowRecorded_CF
- Shows Recently Recorded view: Type=Event EventLog=”Media Center” (EventLevel=4) (Source=Recording) ” started recording on ” | measure count() by SeriesRecorded_CF
- Shows Recorded Recently view: Type=Event EventLog=”Media Center” (EventLevel=4) (Source=Recording) ” started recording on ” | select ShowRecorded_CF
(The ShowManuallyDeleted_CF field is not currently in use for this solution)
For more information on Custom fields see: https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-custom-fields
Thank you to Stan for his help with using Custom Logs – I could not have been able to get this solution anywhere near as functional without his insights!
Summary: The solution in this blog post provides a pretty quick way to visualize relevant information about Windows Media Center from anywhere at any time. Microsoft OMS’ ability to gather data from a variety of sources (like windows events and performance counters in this case), combined with the ability to develop custom fields provides a powerful way to visualize data from a variety of sources including something like a Windows Media Center system.