【发布时间】:2020-06-05 16:54:45
【问题描述】:
我正在尝试对我的 DNS 区域运行以下查询,以根据 IP 地址返回记录,但运气不佳,脚本运行但只是空输出。
Get-Content ip.txt| ForEach {
Get-DnsServerResourceRecord -zonename "xxx.global" | where-object {$_.RecordData.ipv4address -eq "$_"}
}
ip.txt文件的内容是这样的:
"10.32.84.102"
"172.31.65.18"
"172.31.65.203"
我尝试修改运行正常的原始命令,但我想针对 IP 列表运行它..
Get-DnsServerResourceRecord -zonename "xxx.global" | where-object {$_.RecordData.ipv4address -eq "10.32.84.102"}
我做错了什么?
【问题讨论】:
标签: powershell dns active-directory zone