windows-powershell-docs icon indicating copy to clipboard operation
windows-powershell-docs copied to clipboard

Piping results to add-dnsserverqueryresolutionpolicy fails

Open rellington71 opened this issue 3 years ago • 0 comments

$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.

rellington71 avatar Aug 02 '22 20:08 rellington71