如何从 Active Directory Kerberos 策略中获取票证生命周期?基本上,我需要访问此处找到的值:Computer Configuration > Policy > Windows Settings > Security Settings > Account Policies > Kerberos Policy。
(在 Windows Serve 2003 和 Windows Serve 2008 中)
如何从 Active Directory Kerberos 策略中获取票证生命周期?基本上,我需要访问此处找到的值:Computer Configuration > Policy > Windows Settings > Security Settings > Account Policies > Kerberos Policy。
(在 Windows Serve 2003 和 Windows Serve 2008 中)
这可以使用 WMI 完成。特别是在 .NET 中,您需要使用WMI.NET。要找到您正在寻找的特定值,我建议您使用此工具:
http://thepowershellguy.com/blogs/posh/archive/2007/03/22/powershell-wmi-explorer-part-1.aspx
这允许您使用查询浏览 CIMV2 根目录和 futz,直到您确定您的查询正确,然后您可以将查询粘贴到您的 WMI.NET 代码中。
它看起来像这样:
WqlObjectQuery wqlQuery = new WqlObjectQuery("SELECT * FROM Win32_LogicalDisk");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(wqlQuery);
foreach (ManagementObject disk in searcher.Get())
{
Console.WriteLine(disk.ToString());
}
我认为这实际上是正确的查询(在 VB.NET 中):
http://www.activexperts.com/activmonitor/windowsmanagement/scripts/grouppolicy/
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery _
("Select * from RSOP_SecuritySettingBoolean")
For Each objItem in colItems
Wscript.Echo "Key Name: " & objItem.KeyName
Wscript.Echo "Precedence: " & objItem.Precedence
Wscript.Echo "Setting: " & objItem.Setting
Wscript.Echo
Next