windows-powershell-docs
windows-powershell-docs copied to clipboard
Piping results to add-dnsserverqueryresolutionpolicy fails
$policies = Get-DnsServerQueryResolutionPolicy -ZoneName "contoso.com" -ComputerName computer1 $policies
Name ProcessingOrder IsEnabled Action
ServerPolicy 1 True Allow ServerPolicy 2 True Allow ServerPolicy 3 True Allow ServerPolicy 4 True Allow DefaultPolicy 5 True Allow
PS C:\Windows\system32> $policies | Add-DnsServerQueryResolutionPolicy -ZoneName "contoso.com" -ComputerName computer2 Add-DnsServerQueryResolutionPolicy : The parameter is incorrect. At line:1 char:14
- ... $policies | Add-DnsServerQueryResolutionPolicy -ZoneName "contoso.com" - ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidArgument: (PS_DnsServerQueryResolutionPolicy:root/Microsoft/...esolutionPolicy) [Add-DnsServerQueryResolutionPolicy], CimException
- FullyQualifiedErrorId : WIN32 87,Add-DnsServerQueryResolutionPolicy
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: c8d0c968-3149-80f5-662b-2350e347b69e
- Version Independent ID: ea19a92e-44ef-c637-3135-4a2e4ffe5453
- Content: Add-DnsServerQueryResolutionPolicy (DnsServer)
- Content Source: docset/winserver2022-ps/dnsserver/Add-DnsServerQueryResolutionPolicy.md
- Product: w10
- Technology: windows
- GitHub Login: @JasonGerend
- Microsoft Alias: jgerend