Set-DhcpServerv4Policy

Set-DhcpServerv4Policy

Sets the properties of an existing policy either at the server level or at the specified scope level.

Sintaxis

Parameter Set: Set3
Set-DhcpServerv4Policy [-Name] <String> [[-ScopeId] <IPAddress> ] [-AsJob] [-CimSession <CimSession[]> ] [-CircuitId <String[]> ] [-ClientId <String[]> ] [-ComputerName <String> ] [-Condition <String> ] [-Description <String> ] [-Enabled <Boolean> ] [-Fqdn <String[]> ] [-LeaseDuration <TimeSpan> ] [-MacAddress <String[]> ] [-NewName <String> ] [-PassThru] [-ProcessingOrder <UInt16> ] [-RelayAgent <String[]> ] [-RemoteId <String[]> ] [-SubscriberId <String[]> ] [-ThrottleLimit <Int32> ] [-UserClass <String[]> ] [-VendorClass <String[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

The Set-DhcpServerv4Policy cmdlet sets the properties of an existing policy either at the server level or at the specified scope level. If the CircuitId, ClientId, Fqdn, MACAddress, RelayAgent, RemoteId, SubscriberId, UserClass, or VendorClass parameter is specified, then the conditions of the policy are being changed and this cmdlet will behave as follows:

If the VendorClass parameter is specified and the policy being modified already has conditions for the VendorClass parameter value, then the existing VendorClass parameter value is removed and the new VendorClass parameter value will be added.

However, if the policy being modified has conditions for the MacAddress parameter value, then the MacAddress parameter value is not altered and is logically combined (ORꞌd) or differenced (ANDꞌd) with the VendorClass-based conditions.

The same applies to any of the CircuitId, ClientId, Fqdn, MACAddress, RelayAgent, RemoteId, SubscriberId, UserClass, or VendorClass parameters used in the conditions.

Parámetros

-AsJob

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-CimSession<CimSession[]>

Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.

Alias

Session

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-CircuitId<String[]>

Specifies the comparator to use and the values with which to compare the circuit identifier (ID) sub-option. The first element is the comparator, EQ or NE, followed by a single value. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The value can be followed by another comparator, EQ or NE, which is followed by another value.
The input format for the value is a hexadecimal string with or without hyphen separation.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ClientId<String[]>

Specifies the comparator to use and the values with which to compare the client identifier. The first element is the comparator, EQ or NE, followed by a set of values. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The values can be followed by another comparator, EQ or NE, which is followed by another set of values.
The input format is a hexadecimal string with or without hyphen separation. The output format is a hexadecimal string with hyphen separation.
The values following the EQ operator will be treated as multiple assertions which are logically combined (ORꞌd).
The values following the NE operator will be treated as multiple assertions which are logically differenced (ANDꞌd).
An example of the format is: EQ, 00-11-22-33-44-55, AA-BB-CC-DD-EE*.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ComputerName<String>

Specifies the DNS name, or IPv4 or IPv6 address, of the target computer running the Dynamic Host Configuration Protocol (DHCP) server service.

Alias

Cn

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Condition<String>

Specifies the logical operator between the conditions when multiple conditions are specified. Los valores aceptables para este parámetro son los siguientes: AND or OR.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Description<String>

Specifies the description to set on the policy.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Enabled<Boolean>

Specifies the enabled state for the policy. Los valores aceptables para este parámetro son los siguientes: True or False.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Fqdn<String[]>

Specifies the comparator to use and the values with which to compare the fully qualified domain name (FQDN) in the client request. The first element is the comparator, EQ, NE, Isl, or Insl and the subsequent elements are values. For the comparators Island Insl, use a blank value. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The values can again be followed by another comparator, EQ or NE, which is followed by another set of values.
The input format is a string. A trailing wildcard character can be present to indicate partial match.
The values following the EQ operator are treated as multiple assertions which are logically combined (OR’d).
The values following the NE operator are treated as multiple assertions which are logically differenced (AND’d).

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-LeaseDuration<TimeSpan>

Specifies the duration of the lease for clients that match the policy.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-MacAddress<String[]>

Specifies the comparator to use and the values with which to compare the MAC Address in the client request. The first element is the comparator, EQ or NE, followed by a set of values. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The values can be followed by another comparator, EQ or NE, which is followed by another set of values.
The input format is a hexadecimal string with or without hyphen separation. A trailing wildcard character can be used to indicate partial match. The output format is a hexadecimal string with hyphen separation.
The values following the EQ operator will be treated as multiple assertions which are logically combined (ORꞌd).
The values following the NE operator will be treated as multiple assertions which are logically differenced (ANDꞌd).
An example of the format is: 00-1F-3B-7C-B7-89, 00-1F-3B-7C-B7-*, 001F3B7CB789.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Name<String>

Specifies the name of the policy being modified.

Alias

ninguno

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-NewName<String>

Specifies the new name to set for the policy.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-PassThru

Devuelve un objeto que representa el elemento con el que está trabajando. De forma predeterminada, este cmdlet no genera ningún resultado.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-ProcessingOrder<UInt16>

Specifies the order for this policy with respect to other policies in the scope or DHCP server service. The DHCP server service will process the policies in the specified order while evaluating client requests using the configured policies.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-RelayAgent<String[]>

Specifies the comparator to use and the values with which to compare the relay agent information. The first element is the comparator, EQ or NE, followed by a set of values. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The values can be followed by another comparator, EQ or NE, which is followed by another set of values.
The input format is a hexadecimal string with or without hyphen separation.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-RemoteId<String[]>

Specifies the comparator to use and the values with which to compare the remote ID suboption. The first element is the comparator, EQ or NE, followed by a single value. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The value can again be followed by another comparator, EQ or NE, which is followed by another value.
The input format for the value is a hexadecimal string with or without hyphen separation.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ScopeId<IPAddress>

Specifies the scope ID, in IPv4 address format, of the scope which contains the policy. If this parameter is not specified, then the server level policy is modified.

Alias

ninguno

¿Requerido?

false

¿Posición?

3

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-SubscriberId<String[]>

Specifies the comparator to use and the values with which to compare the subscriber ID suboption. The first element is the comparator, EQ or NE, and followed by a single value. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The value can again be followed by another comparator, EQ or NE, which is followed by another value.
The input format is a hexadecimal string with or without hyphen separation.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ThrottleLimit<Int32>

Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-UserClass<String[]>

Specifies the comparator to use and the user class values with which to compare the user class field in the client request. The first element to be specified is the comparator, EQ or NE, and followed by a set values. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The values can be followed by another comparator, EQ or NE, which is followed by another set of values.
The values to be specified must be the user class names that already exist on the DHCP server service.
The format of the value should be a hexadecimal string starting with 0x.
The values following the EQ operator are treated as multiple assertions which are logically combined (ORꞌd).
The values following the NE operator are treated as multiple assertions which are logically differenced (ANDꞌd).

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-VendorClass<String[]>

Specifies the comparator to use and the vendor class values with which to compare the vendor class field in the client request. The first element is the comparator, EQ or NE, followed by a set of values. If the last character in a value is an asterisk, then the subsequent characters are treated as wildcard characters for the comparison. If the first character in a value-element is an asterisk, the preceding characters are treated as wild cards for comparison.
The values can be followed by another comparator. EQ or NE, which is followed by another set of values.
The values to be specified must be the vendor class names that already exist on the DHCP server service.
The format of the value should be a hexadecimal string starting with 0x.
The values following the EQ operator are treated as multiple assertions which are logically combined (ORꞌd).
The values following the NE operator are treated as multiple assertions which are logically differenced (ANDꞌd).

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Confirm

Solicita confirmación antes de ejecutar el cmdlet.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-WhatIf

Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

Ejemplos

EXAMPLE 1

This example renames the server level policy named DevicesPolicy to TabletPolicy, sets a description string, disables the policy, and sets the processing order to 4.

PS C:\> Set-DhcpServerv4Policy -ComputerName dhcpserver.contoso.com -Name DevicesPolicy -NewName TabletPolicy -Description "policy for tablet devices" -ProcessingOrder 4 -Enabled False

EXAMPLE 2

This example modifies the conditions of the server level policy for non-Hyper-V clients. If the policy had an existing MAC address based condition, then the same condition is replaced with the condition specified in this cmdlet. However, if the policy had conditions based on other fields, such as the VendorClass, UserClass, ClientId, or RelayAgent parameters, then those will be retained and logically combined (ORꞌd) with the newly added MAC address based condition.

PS C:\> Set-DhcpServerv4Policy -Name PhysicalMachinesPolicy -Condition OR -MacAddress NE,00155D*,000569*

EXAMPLE 3

This example modifies the conditions of the server level policy for non-Hyper-V clients. If the policy had an existing MAC address based condition, a vendor class based policy, or both, then the conditions are replaced with the condition specified in this cmdlet.

PS C:\> Set-DhcpServerv4Policy -Name PhysicalMachinesPolicy -Condition OR -MacAddress NE,00155D*,000569* -VendorClass ""

EXAMPLE 4

This example sets the lease duration for the server level policy named TabletPolicy to 10 days for the specified computer.

PS C:\> Set-DhcpServerv4Policy -Name TabletPolicy -ComputerName dhcpserver.contoso.com -LeaseDuration 10

Temas relacionados

Add-DhcpServerv4Policy

Add-DhcpServerv4PolicyIPRange

Get-DhcpServerv4Policy

Get-DhcpServerv4PolicyIPRange

Remove-DhcpServerv4Policy

Remove-DhcpServerv4PolicyIPRange