我正在尝试获取有关RSOP_SecuritySettingBoolean
的一些信息,但它会返回一个空集合。难道我做错了什么?没有域名的Win7 x64 HP:
var options = new ConnectionOptions();
var scope = new ManagementScope(@"\\.\root\RSOP\Computer", options);
var objectQuery = new ObjectQuery("SELECT * FROM RSOP_SecuritySettingBoolean");
using (var searcher = new ManagementObjectSearcher(scope, objectQuery))
{
foreach (ManagementObject o in searcher.Get())
{
Console.WriteLine("Key Name: {0}", o["KeyName"]);
Console.WriteLine("Precedence: {0}", o["Precedence"]);
Console.WriteLine("Setting: {0}", o["Setting"]);
}
}