【问题标题】:Dump all DNS entries from Active Directory DNS using PowerShell?使用 PowerShell 从 Active Directory DNS 转储所有 DNS 条目?
【发布时间】:2016-01-25 20:33:41
【问题描述】:

我需要分析存储在 Active Directory DNS 服务器中的大量条目。是否有 PowerShell 方法可以检索区域中包含的所有条目?

我可以找到基于主机名或 IP 进行 DNS 查找的脚本;和其他人在 DNS 中创建条目。但是,我正在寻找一种将所有 DNS 条目转储到 CSV 中以便在另一个应用程序中进行分析的方法。

感谢任何帮助。

【问题讨论】:

    标签: powershell dns active-directory


    【解决方案1】:

    是的,您需要在计算机上安装 DNS 管理工具(可能是 RSAT),在足够新的 Windows/PowerShell 版本(可能是 2012/v3 或更高版本)上。模块是DnsServer

    Import-Module DnsServer
    Get-DnsServerZone -ComputerName MyDC
    

    查看其他命令:

    Get-Command -Module DnsServer
    

    TechNet site

    Get-DnsServerResourceRecord 可能是你想要的。

    In some circumstances Get-DnsServerResourceRecord can return duplicates 所以要小心。

    【讨论】:

    • Get-DnsServerResourceRecord 正是我们所期待的。我找到了正确的文档on this link at TechNet。它让我得到了我需要的东西:Get-DnsServerResourceRecord -ComputerName my_dns_server -ZoneName my_zone.com -RRType A。谢谢!
    猜你喜欢
    • 2019-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多