Windows Policy Setting and Lookup Framework for use with the AdmxParser package
- All of
~Coremethods has been hided. These methods are not intended to be used by the user.
Set~~~PoliciesandDelete~~~Policiesmethods has been changed return type from collection to count integer. You can lookup the result in the request object.
The code has been completely redeveloped to use AdmxParser's interpreted model, and it has been completely redeveloped to ensure stable operation, and is equipped with code that is completely different from the existing 0.5.x version.
- Requires a platform with .NET Standard 2.0 or later, and Windows Vista+, Windows Server 2008+
- Supported .NET Version: .NET Core 2.0+, .NET 5+, .NET Framework 4.6.1+, Mono 5.4+, UWP 10.0.16299+, Unity 2018.1+
The code below is a simple depiction of how to use it. We'll add more full code examples as they become available.
var admxDirectory = AdmxDirectory.GetSystemPolicyDefinitions();
await admxDirectory.LoadAsync();
var inetres = admxDirectory.GetAdmxContentByPrefix("inetres");
var fontSizePolicy = inetres.GetUserPolicy("FontSize");
fontSizePolicy.SetUserPolicy(true);
var elemIdList = fontSizePolicy.GetElementIds();
var elemId = elemIdList.FirstOrDefault(x => string.Equals("FontSizeDefault", x, StringComparison.OrdinalIgnoreCase));
var value = 2;
var queryResult = fontSizePolicy.GetUserElement(elemId);
Console.Out.WriteLine(queryResult.Value);This library follows Apache-2.0 license. See LICENSE file for more information.