【问题标题】:How do I get the AD Kerberos ticket lifetime using .NET?如何使用 .NET 获得 AD Kerberos 票证生命周期?
【发布时间】:2011-05-14 23:35:58
【问题描述】:

如何从 Active Directory Kerberos 策略中获取票证生命周期?基本上,我需要访问此处找到的值:计算机配置 > 策略 > Windows 设置 > 安全设置 > 帐户策略 > Kerberos 策略

(在 Windows Serve 2003 和 Windows Serve 2008 中)

【问题讨论】:

    标签: .net kerberos windows-server


    【解决方案1】:

    这可以使用 WMI 来完成。特别是在 .NET 中,您需要使用 WMI.NET。要找到您正在寻找的特定值,我建议您使用此工具:

    http://thepowershellguy.com/blogs/posh/archive/2007/03/22/powershell-wmi-explorer-part-1.aspx

    这允许您使用查询浏览 CIMV2 根目录和 futz,直到您确定您的查询正确,然后您可以将查询粘贴到您的 WMI.NET 代码中。

    它看起来像 this:

    WqlObjectQuery wqlQuery = new WqlObjectQuery("SELECT * FROM Win32_LogicalDisk");
    ManagementObjectSearcher searcher = new ManagementObjectSearcher(wqlQuery);
    
    foreach (ManagementObject disk in searcher.Get()) 
    {
      Console.WriteLine(disk.ToString());
    }
    

    【讨论】:

      【解决方案2】:

      我认为这实际上是正确的查询(在 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
      

      【讨论】:

        猜你喜欢
        • 2013-01-18
        • 2013-12-07
        • 2010-11-06
        • 1970-01-01
        • 2018-04-02
        • 1970-01-01
        • 2016-05-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多