Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8661353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:28:39+00:00 2026-06-12T16:28:39+00:00

I’m attempting to write some C# code to programmatically read/write the Family Safety controls

  • 0

I’m attempting to write some C# code to programmatically read/write the Family Safety controls in Windows 8, in particular the Web and Application Filter lists.

WMI can expose the values with a command such as:

PS C:\Windows\system32> Get-WmiObject -Class WpcURLOverride -Namespace root/CIMV2/Applications/WindowsParentalControls

__GENUS          : 2
__CLASS          : WpcURLOverride
__SUPERCLASS     :
__DYNASTY        : WpcURLOverride
__RELPATH        : WpcURLOverride.SID="S-1-5-21-4241459202-2635765079-3956675256-1002",URL="http://block.com"
__PROPERTY_COUNT : 3
__DERIVATION     : {}
__SERVER         : TEST-BOX
__NAMESPACE      : root\CIMV2\Applications\WindowsParentalControls
__PATH           : \\TEST-BOX\root\CIMV2\Applications\WindowsParentalControls:WpcURLOverride.SID="S-1-5-21-4241459202-2
                   635765079-3956675256-1002",URL="http://block.com"
Allowed          : 2
SID              : S-1-5-21-4241459202-2635765079-3956675256-1002
URL              : http://block.com
PSComputerName   : TEST-BOX

__GENUS          : 2
__CLASS          : WpcURLOverride
__SUPERCLASS     :
__DYNASTY        : WpcURLOverride
__RELPATH        : WpcURLOverride.SID="S-1-5-21-4241459202-2635765079-3956675256-1002",URL="http://allow.com"
__PROPERTY_COUNT : 3
__DERIVATION     : {}
__SERVER         : TEST-BOX
__NAMESPACE      : root\CIMV2\Applications\WindowsParentalControls
__PATH           : \\TEST-BOX\root\CIMV2\Applications\WindowsParentalControls:WpcURLOverride.SID="S-1-5-21-4241459202-2
                   635765079-3956675256-1002",URL="http://allow.com"
Allowed          : 1
SID              : S-1-5-21-4241459202-2635765079-3956675256-1002
URL              : http://allow.com
PSComputerName   : TEST-BOX

This question mentions duplicating an existing object, but I haven’t found a way to do so with generic or these specific WMI objects.

How do I insert or remove entries?
Thanks for your input.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:28:41+00:00Added an answer on June 12, 2026 at 4:28 pm

    Posting a viable, if not ideal, answer for completeness. These snippets apply rather specificly to my use case, but hopefully they can help someone

      private static SecurityIdentifier UserSID(string username)
      {
         var f = new NTAccount(username);
         return (SecurityIdentifier)f.Translate(typeof(SecurityIdentifier));
      }
    
    
      private string PsCmdAddSite(Uri url, bool allow)
      {
         return string.Format(
    @"$o = ([WMIClass] ""root\CIMV2\Applications\WindowsParentalControls:WpcURLOverride"").CreateInstance()
    $o.Allowed = {0}
    $o.URL = ""{1}""
    $o.SID = ""{2}""
    $o.Put()", (allow ? "1" : "2"), url, UserSID('TargetUsername'));
      }
    
    
      private static string PsCmdRemoveAllSites()
      {
         return
    @"$allSites = Get-WmiObject -Class WpcURLOverride -Namespace root/CIMV2/Applications/WindowsParentalControls;
    foreach ($site in $allSites){Remove-WmiObject -InputObject $site;}";
      }
    
    
      private static void RunPsScript( string scriptText )
      {
         // create Powershell runspace, logically a single PS session
         Runspace runspace = RunspaceFactory.CreateRunspace();
         runspace.Open();
    
         // create a pipeline and feed the script text
         Pipeline pipeline = runspace.CreatePipeline();
         pipeline.Commands.AddScript(scriptText);
    
         pipeline.Commands.Add("Out-String");
    
         // execute the script
         pipeline.Invoke();
         runspace.Close();
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Seemingly simple, but I cannot find anything relevant on the web. What is the
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.