Showing the Windows Parental Controls system settings.

There are a few elements of information you can get out of the system settings for WPC, allowing you to see how various aspects of the parental controls system is setup.  It is easy enough to read these settings using WMI and some javascript so we can see/use these settings in other places.

This will be a super set of the DumpRestrictions.js I showed last time.  As well as the Http exemptions and the url exemptions you can get the current games rating system, the number of days to wait until a balloon is shown to the user, the id and name of the current web filter (seeing if a custom web filter is being used).

The games rating system is a GUID that is associated with the specific rating system.  Finding the details of this rating system is not possible using the public APIs.  The details on the rating systems can be found by looking at the regkey HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Parental Controls\Ratings Systems\Games, which turns the guids into the name of the specific rating system.  ie: the guid of {768BD93D-63BE-46A9-8994-0B53C4B5248F} points to esrb.rs.  The esrb.rs file is in the %WINDIR%\system32\esrb.rs directory and is a resource only file and you can see the details of it by loading it up into visual studio, or any other program that allows you to look at registry files.

The Filter ID is an extension ID, the extensions are all registered in system and can be found by enumerating the WpcExtension class in WMI.

The log reminder interval is time (in days) between when we will show the reminder balloon for looking at the logs.  The last log view time is set when you look at the logs inside the activity viewer.

 

 

// Setup some defines for the rest of the script, points to the local machine
// and the parental controls namespace.
strComputer = ".";
strRootNamespace = "\\ROOT\\CIMV2";
strNamespace = strRootNamespace + "\\Applications\\WindowsParentalControls";

// Connect to WMI and get the system settings object.
strConnectStr = "winmgmts:\\\\" + strComputer + strNamespace;
sysSettings = GetObject(strConnectStr + ":WpcSystemSettings=@");

// The game rating system
rating = sysSettings.CurrentGamesRatingSystem;
WScript.Echo("Current Game Rating System: " + rating);

// Log reminder interval.
interval = sysSettings.LogViewReminderInterval;
WScript.Echo("Log View Reminder Interval: " + interval);

// Last log view
lastview = sysSettings.LastLogView;
WScript.Echo("Last log view : " + lastview);

// Web filter
id = sysSettings.FilterID;
name = sysSettings.FilterName;
WScript.Echo("Web Filter : " + name + " (" + id + ")");