Set-DhcpServerv4OptionValue

Set-DhcpServerv4OptionValue

Sets an IPv4 option value at the server, scope, or reservation level.

Sintaxis

Parameter Set: OptionIds
Set-DhcpServerv4OptionValue [-OptionId] <UInt32> [-Value] <String[]> [[-ScopeId] <IPAddress> ] [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-Force] [-PassThru] [-PolicyName <String> ] [-ReservedIP <IPAddress> ] [-ThrottleLimit <Int32> ] [-UserClass <String> ] [-VendorClass <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CommonOptions
Set-DhcpServerv4OptionValue [[-ScopeId] <IPAddress> ] [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-DnsDomain <String> ] [-DnsServer <IPAddress[]> ] [-Force] [-PassThru] [-PolicyName <String> ] [-ReservedIP <IPAddress> ] [-Router <IPAddress[]> ] [-ThrottleLimit <Int32> ] [-UserClass <String> ] [-WinsServer <IPAddress[]> ] [-Wpad <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

The Set-DhcpServerv4OptionValue cmdlet sets an IPv4 option value at the server, scope, or reservation level. The definition for the option must already exist. This cmdlet will fail if the option definition does not exist in the Dynamic Host Configuration Protocol (DHCP) server service. If only the ReservedIP parameter is specified, then the option values are set at the reservation level. If only the ScopeId parameter is specified, then the option values are set at the scope level. If neither the ScopeId nor ReservedIP parameter is specified, then the option values are set at the server level. If the VendorClass parameter is specified, then the option value is set for that vendor class. If the UserClass parameter is specified, then the option value is set for that user class. If the PolicyName parameter is specified, then the option values are set for that policy. The UserClass and PolicyName parameters cannot both be specified. The ScopeId and ReservedIP parameters cannot both be specified.

The PolicyName and ReservedIP parameters cannot both be specified.

Note: The option values for policies can only be set for a DHCP server service running on Windows Server® 2012. Setting user class options for a DHCP server service running on Windows Server 2012 creates of a policy with the policy name set to the name of the user class. For a DHCP server service running on or earlier, only option values based upon the user class can be set.

To set options based upon legacy user classes, then the UserClass parameter must be specified.

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

-ComputerName<String>

Specifies the DNS name, or IPv4 or IPv6 address, of the target computer running the DHCP server service.

Alias

Cn

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-DnsDomain<String>

Specifies the value for the DNS domain option.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-DnsServer<IPAddress[]>

Specifies one or more values for the DNS server option, in the IPv4 address format.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Force

Specifies that the DNS server validation will be skipped. This parameter is only applicable if the DnsServer parameter is specified.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-OptionId<UInt32>

Specifies the numeric identifier (ID) of the option for which one or more values are set.

Alias

ninguno

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿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

-PolicyName<String>

Specifies the name of the policy for which one or more option values are set.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ReservedIP<IPAddress>

Specifies the IPv4 address of the reservation for which one or more option values are set.

Alias

IPAddress

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Router<IPAddress[]>

Specifies one or more values for the router or default gateway option, in IPv4 address format.

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 for which one or more option values are set.

Alias

ninguno

¿Requerido?

false

¿Posición?

4

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>

Sets the option value for the specified user class.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Value<String[]>

Specifies one or more values to be set for the option. The format that the values need to be specified is specified per the data type of the options as follows:
-- Byte, Word, DWord, DWordDword: The values need to be specified as decimal or hexadecimal strings
-- IPAddress, IPv6Address: The values will need to be specified as strings
-- String: The values will need to be specified as strings
-- BinaryData, EncapsulatedData: The values will need to be specified as hexadecimal strings

Alias

ninguno

¿Requerido?

true

¿Posición?

3

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-VendorClass<String>

Sets the option value for the specified vendor class.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-WinsServer<IPAddress[]>

Specifies the values for the WINS server option, in IPv4 address format.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Wpad<String>

Specifies the value for the web proxy auto detection option. The value for this option is specified as a URL.

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 sets the server level option values for DNS server, WINS server, DNS domain, router, and WPAD.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -DnsServer 192.168.1.2 -WinsServer 192.168.1.3 -DnsDomain contoso.com -Router 192.168.1.1 -Wpad http://proxy.contoso.com/wpad.dat

EXAMPLE 2

This example sets the option values for DNS server, WINS server, DNS domain, router, and WPAD for scope 10.10.10.0.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -DnsServer 192.168.1.2 -WinsServer 192.168.1.3 -DnsDomain contoso.com -Router 192.168.1.1 -Wpad http://proxy.contoso.com/wpad.dat

EXAMPLE 3

This example sets the option values for DNS server, WINS server, DNS domain, router, and WPAD for reserved IP address 10.10.10.5.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ReservedIP 10.10.10.5 -DnsServer 192.168.1.2 -WinsServer 192.168.1.3 -DnsDomain contoso.com -Router 192.168.1.1 -Wpad http://proxy.contoso.com/wpad.dat

EXAMPLE 4

This example sets the option values for DNS server, WINS server, DNS domain, router, and WPAD for policy named LabComputers in the scope 10.10.10.0.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -PolicyName LabComputers -DnsServer 192.168.1.2 -WinsServer 192.168.1.3 -DnsDomain contoso.com -Router 192.168.1.1 -Wpad http://proxy.contoso.com/wpad.dat

EXAMPLE 5

This example sets the server-wide DHCPv4 option value for option ID 6, or DNS server.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -OptionId 6 -Value 192.168.1.1

EXAMPLE 6

This example sets the DHCPv4 option value for option ID 6, or DNS server, for the scope 10.10.10.0.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -OptionId 6 -Value 192.168.1.1

EXAMPLE 7

This example sets the DHCPv4 option value for option ID 6, or DNS server, for the specified reservation.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ReservedIP 10.10.10.5 -OptionId 6 -Value 192.168.1.1

EXAMPLE 8

This example sets the vendor-class-specific DHCPv4 option value for option ID 5 on the specified scope for the specified vendor class named MSUCClient.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -VendorClass MSUCClient -OptionId 5 -Value 6874747073

EXAMPLE 9

This example sets the DHCPv4 option value for option ID 6, or DNS server, on the specified scope for the specified policy.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -PolicyName PrinterPolicy -OptionId 6 -Value 192.168.1.10

EXAMPLE 10

This example sets the user-class-specific DHCPv4 option value for option ID 6, or DNS server, on the specified scope for the specified user class.

PS C:\> Set-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -UserClass LabComputer -OptionId 6 -Value 192.168.1.10

EXAMPLE 11

This example sets the vendor-class-specific DHCPv4 option value for option ID 43, or embedded vendor-specific options, on the specified scope.

PS C:\> Set-DhcpServerv4OptionValue -ScopeId 10.10.10.0 -OptionId 43 -Value "241","08","33","255","132","10","33","255","133"

Temas relacionados

Get-DhcpServerv4OptionValue

Remove-DhcpServerv4OptionValue