Add-DnsServerZoneTransferPolicy
Mis à jour: mai 2015
Add-DnsServerZoneTransferPolicy
Adds a zone transfer policy to a DNS server.
Syntaxe
Parameter Set: InputObject
Add-DnsServerZoneTransferPolicy [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-InformationAction <System.Management.Automation.ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <System.String> ] [-PassThru] [-ThrottleLimit <Int32> ] [-ZoneName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]
Parameter Set: Server
Add-DnsServerZoneTransferPolicy [-Name] <String> [[-Action] <String> {DENY | IGNORE} ] [[-Condition] <String> {AND | OR} ] [-CimSession <CimSession[]> ] [-ClientSubnet <String> ] [-ComputerName <String> ] [-Disable] [-InformationAction <System.Management.Automation.ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <System.String> ] [-InternetProtocol <String> ] [-PassThru] [-ProcessingOrder <UInt32> ] [-ServerInterfaceIP <String> ] [-ThrottleLimit <Int32> ] [-TimeOfDay <String> ] [-TransportProtocol <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]
Parameter Set: Zone
Add-DnsServerZoneTransferPolicy [-Name] <String> [-ZoneName] <String> [[-Action] <String> {DENY | IGNORE} ] [[-Condition] <String> {AND | OR} ] [-CimSession <CimSession[]> ] [-ClientSubnet <String> ] [-ComputerName <String> ] [-Disable] [-InformationAction <System.Management.Automation.ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <System.String> ] [-InternetProtocol <String> ] [-PassThru] [-ProcessingOrder <UInt32> ] [-ServerInterfaceIP <String> ] [-ThrottleLimit <Int32> ] [-TimeOfDay <String> ] [-TransportProtocol <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]
Description détaillée
The Add-DnsServerZoneTransferPolicy cmdlet adds a zone transfer policy to a Domain Name System (DNS) server. A policy determines zone transfers based on criteria that you specify in the policy.
A policy consists of criteria and action.
The criteria are a logical combination of client subnet, server interface IP address, fully qualified domain name (FQDN), Internet Protocol (IPv4/IPv6), transport protocol (UDP/TCP), time of day, and query type.
Specify criteria in the following format:
operator, value01, value02, . . . , operator, value03, value04, . . .
The operator is either EQ or NE. You can specify no more than one of each operator in a criterion.
The policy treats values that follow the EQ operator as multiple assertions which are logically combined (OR'd). The policy treats values that follow the NE operator as multiple assertions which are logically differenced (AND'd).
This cmdlet combines multiple criteria by using the value of the Condition parameter as the logical operator. This parameter takes one of the following values:
-- OR. The policy evaluates criteria as multiple assertions which are logically combined (OR'd).
-- AND. The policy evaluates criteria as multiple assertions which are logically differenced (AND'd).
If a query meets the criteria of a policy, the action is the response that the policy requires. You can specify DENY or IGNORE.
You can create policies for zone transfer at either the server level or the zone level. Server level policies apply on every zone transfer query that occurs on the DNS server. Zone level policies apply only on the queries on a zone hosted on the DNS server. The most common use for zone level policies is to implement blocked or safe lists.
Zone level policies apply to the zone in which you create them. You cannot create a zone level policy without a zone. If you remove a zone, that removal deletes the associated zone level policies.
Paramètres
-Action<String>
Specifies the action to take if a zone transfer matches this policy. Les valeurs acceptables pour ce paramètre sont les suivantes :
-- DENY. Respond with SERV_FAIL.
-- IGNORE. Do not respond.
Alias |
none |
Requis ? |
false |
Position ? |
4 |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-CimSession<CimSession[]>
Exécute l'applet de commande dans une session distante ou sur un ordinateur distant. Entrez un nom d'ordinateur ou un objet de session, tels que le résultat d'une applet de commande New-CimSession ou Get-CimSession. La valeur par défaut est la session en cours sur l'ordinateur local.
Alias |
Session |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-ClientSubnet<String>
Specifies the client subnet criterion. For more information, see Add-DnsServerClientSubnet. Specify a criterion in the following format:
operator, value01, value02, . . . , operator, value03, value04, . . .
The operator is either EQ or NE. You can specify no more than one of each operator in a criterion.
The policy treats values that follow the EQ operator as multiple assertions which are logically combined (OR'd). The policy treats values that follow the NE operator as multiple assertions which are logically differenced (AND'd). The criterion is satisfied if the subnet of the zone transfer matches one of the EQ values and does not match any of the NE values.
Example criterion: "EQ,NorthAmerica,Asia,NE,Europe"
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-ComputerName<String>
Specifies a remote DNS server. You can specify an IP address or any value that resolves to an IP address, such as an FQDN, host name, or NETBIOS name.
Alias |
Cn |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-Condition<String>
Specifies how the policy treats multiple criteria. Les valeurs acceptables pour ce paramètre sont les suivantes :
-- OR. The policy evaluates criteria as multiple assertions which are logically combined (OR'd).
-- AND. The policy evaluates criteria as multiple assertions which are logically differenced (AND'd).
The default value is AND.
Alias |
none |
Requis ? |
false |
Position ? |
5 |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-Disable
Indicates that this cmdlet disables the policy. If you do not specify this parameter, the cmdlet creates the policy and enables it.
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-InformationAction<System.Management.Automation.ActionPreference>
Alias |
infa |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-InformationVariable<System.String>
Alias |
iv |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-InternetProtocol<String>
Specifies the Internet Protocol criterion. Valid values are: IPv4 and IPv6. Specify a criterion in the following format:
operator, value01, value02, . . . , operator, value03, value04, . . .
The operator is either EQ or NE. You can specify no more than one of each operator in a criterion.
The policy treats values that follow the EQ operator as multiple assertions which are logically combined (OR'd). The policy treats values that follow the NE operator as multiple assertions which are logically differenced (AND'd). The criterion is satisfied if the IP address of the zone transfer matches one of the EQ values and does not match any of the NE values.
Example criteria: "EQ,IPv4"
and "EQ,IPv6"
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-Name<String>
Specifies a name for the new policy.
Alias |
none |
Requis ? |
true |
Position ? |
2 |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-PassThru
Renvoie un objet qui représente l'élément sur lequel vous travaillez. Par défaut, cette applet de commande ne génère pas de sortie.
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-ProcessingOrder<UInt32>
Specifies the precedence of the policy. Higher integer values have lower precedence. By default, this cmdlet adds a new policy as the lowest precedence.
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-ServerInterfaceIP<String>
Specifies the IP address of the server interface on which the DNS server listens. Specify a criterion in the following format:
operator, value01, value02, . . . , operator, value03, value04, . . .
The operator is either EQ or NE. You can specify no more than one of each operator in the criterion.
The policy treats values the follow the EQ operator as multiple assertions which are logically combined (OR'd). The policy treats values that follow the NE operator as multiple assertions which are logically differenced (AND'd). The criterion is satisfied if the IP address of the interface matches one of the EQ values and does not match any of the NE values.
Example criteria: "EQ,10.0.0.1"
and "NE,192.168.1.1"
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-ThrottleLimit<Int32>
Spécifie le nombre maximal d'opérations simultanées qui peuvent être établies pour exécuter l'applet de commande. Si ce paramètre est omis ou si la valeur 0
est entrée, Windows PowerShell® calcule un seuil de limitation optimal pour l'applet de commande en fonction du nombre d'applets de commande CIM exécutées sur l'ordinateur. Le seuil de limitation s'applique uniquement à l'applet de commande en cours, non pas à la session ou à l'ordinateur.
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-TimeOfDay<String>
Specifies the time of day criterion. Specify a criterion in the following format:
operator, value01, value02, . . . , operator, value03, value04, . . .
The operator is either EQ or NE. You can specify no more than one of each operator in the criterion.
The policy treats values the follow the EQ operator as multiple assertions which are logically combined (OR'd). The policy treats values that follow the NE operator as multiple assertions which are logically differenced (AND'd). The criterion is satisfied if the time of day of the zone transfer matches one of the EQ values and does not match any of the NE values.
Example criterion: "EQ,10:00-12:00,22:00-23:00"
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-TransportProtocol<String>
Specifies the transport protocol criterion. Valid values are: TCP and UDP. Specify a criterion in the following format:
operator, value01, value02, . . . , operator, value03, value04, . . .
The operator is either EQ or NE. You can specify no more than one of each operator in the string.
The policy treats values the follow the EQ operator as multiple assertions which are logically combined (OR'd). The policy treats values that follow the NE operator as multiple assertions which are logically differenced (AND'd). The criterion is satisfied if the transport protocol of the zone transfer matches one of the EQ values and does not match any of the NE values.
Example criterion: "EQ,TCP,NE,UDP"
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-ZoneName<String>
Specifies the name of a DNS zone on which this cmdlet creates a zone level policy. The zone must exist on the DNS server.
Alias |
none |
Requis ? |
true |
Position ? |
3 |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-Confirm
Vous invite à confirmer l'exécution de l'applet de commande.
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
false |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-WhatIf
Indique ce qui se produit en cas d'exécution de l'applet de commande. L'applet de commande n'est pas exécutée.
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
false |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
<CommonParameters>
Cette applet de commande prend en charge les paramètres courants : -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer et -OutVariable. Pour plus d'informations, consultez . about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
<WorkflowParameters>
Entrées
Le type d'entrée correspond au type des objets que vous pouvez adresser à l'applet de commande.
Sorties
Le type de sortie correspond au type des objets que l'applet de commande émet.
- Microsoft.Management.Infrastructure.CimInstance#DnsServerPolicy
Exemples
Example 1: Create a server level zone transfer policy
The first command creates a client subnet named AllowedSubnet by using the Add-DnsServerClientSubnet cmdlet. That subnet includes the specified IP subnet.
The second command creates a zone transfer policy that disallows all customers that do not belong to the AllowedSubnet subnet. This policy is a server level policy, and, so, it applies on all the zones on the server.
PS C:\> Add-DnsServerClientSubnet -Name "AllowedSubnet" -IPv4Subnet 172.21.33.0/24 -PassThru
PS C:\> Add-DnsServerZoneTransferPolicy -Name "NorthAmericaPolicy" -Action IGNORE -ClientSubnet "ne,AllowedSubnet" -PassThru | Format-List *
Example 2: Disallow zone transfers by server interface
This command creates a zone transfer policy that disallows all zone transfer queries that do not arrive on server interface 10.0.0.33.
PS C:\> Add-DnsServerZoneTransferPolicy -Name "InternalTransfers" -Action IGNORE -ServerInterfaceIP "ne,10.0.0.33" -PassThru
Example 3: Create a zone level zone transfer policy
This command creates a zone level zone transfer policy for contoso.com.
PS C:\> Add-DnsServerZoneTransferPolicy -Name "InternalTransfers" -Action IGNORE -ServerInterfaceIP "ne,10.0.0.33" -PassThru -ZoneName "contoso.com" | Format-List *
Rubriques connexes
Get-DnsServerZoneTransferPolicy
Remove-DnsServerZoneTransferPolicy