The WpcUserSettings class, which exists in the root\CIMV2\Applications\WindowsParentalControls namespace, does not provide any method for updating data by the user, but all displayed properties are read / write, with the exception of, obviously, the SID property. You can iterate over properties for a specific user and change values.
So you can make a Wmi request using a sentence similar to finding all users SELECT * FROM WpcUserSettings
or this sentence to change the properties of a specific user
SELECT * FROM WpcUserSettings Where SID="the SID of the user to modify"
then update the values โโof the properties you want to change, and finally call the Put method to set the new values.
check out this sample app.
using System; using System.Collections.Generic; using System.Management; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { try { ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2\\Applications\\WindowsParentalControls", "SELECT * FROM WpcUserSettings"); foreach (ManagementObject queryObj in searcher.Get()) { if (queryObj["SID"] == "The user SID to modify") {
source share