【问题标题】:Active Directory - DNs Forwarders in c#Active Directory - c# 中的 DN 转发器
【发布时间】:2020-05-09 09:39:47
【问题描述】:

我们可以检查 C# .NET 中每个域控制器上配置的 Dns 转发器吗?找不到任何支持这一点的类。

请帮忙。

【问题讨论】:

    标签: c# dns active-directory ldap


    【解决方案1】:

    使用 WSManConnectionInfo 和 Runspace,我可以获取所需的详细信息。

            WSManConnectionInfo connInfo = new WSManConnectionInfo(new Uri("http://ServerName:5985/wsman"));
            Collection<PSObject> output = null;
            string command = "Get-DnsServerForwarder";
            using (Runspace remoteRS = RunspaceFactory.CreateRunspace(connInfo))
            {
                remoteRS.Open();
                using (var pShell = PowerShell.Create())
                {
                    pShell.Commands.AddCommand(command);
                    output = pShell.Invoke();
                }
            }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-02
      • 2021-02-18
      • 1970-01-01
      • 1970-01-01
      • 2019-07-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多