导入Powershell DNS服务器模块

1 dns powershell scripting

我正在通过脚本部署一些虚拟机,我想检查我添加到脚本中的 FQNA 是否已在 DNS 记录中创建。

我找到了执行此操作的命令,但找不到使用这些命令所需的 Powershell 模块。

找到了 DNSserver 和其他,但这不起作用,我有点困惑应该导入/安装哪个模块才能使用 Powershell DNS 命令,例如 get-dnsserverresourcerecord 或 Add-DnsServerResourceRecordA 等。

谢谢

小智 5

我也有这个问题。该模块是 RSAT 的一部分。如果您只想要get-dnsserverresourcerecordor Add-DnsServerResourceRecordA,那就在功能中Rsat.Dns.Tools~~~~0.0.1.0

从 PowerShell 中的提升提示符处:

Add-WindowsCapability -Online -Name Rsat.Dns.Tools~~~~0.0.1.0
Run Code Online (Sandbox Code Playgroud)

如果您想要所有 RSAT 功能:

Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online
Run Code Online (Sandbox Code Playgroud)

在 PowerShell 7.2.5 中验证

在这里找到此信息: https://mikefrobbins.com/2018/10/03/use-powershell-to-install-the-remote-server-administration-tools-rsat-on-windows-10-version-1809/