Set-DhcpServerv4OptionValue

Set-DhcpServerv4OptionValue

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

Syntax

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>]

Detaillierte Beschreibung

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.

Parameter

-AsJob

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-CimSession<CimSession[]>

Führt das Cmdlet in einer Remotesitzung oder auf einem Remotecomputer aus. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, z. B. die Ausgabe eines Cmdlets New-CimSession oder Get-CimSession. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.

Aliasse

Session

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ComputerName<String>

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

Aliasse

Cn

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-DnsDomain<String>

Specifies the value for the DNS domain option.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-DnsServer<IPAddress[]>

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

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-Force

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

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-OptionId<UInt32>

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

Aliasse

Keiner

Erforderlich?

true

Position?

2

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-PassThru

Gibt ein Objekt zurück, das das Element darstellt, mit dem Sie arbeiten. Standardmäßig wird von diesem Cmdlet keine Ausgabe generiert.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-PolicyName<String>

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

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-ReservedIP<IPAddress>

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

Aliasse

IPAddress

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-Router<IPAddress[]>

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

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-ScopeId<IPAddress>

Specifies the scope ID, in IPv4 address format for which one or more option values are set.

Aliasse

Keiner

Erforderlich?

false

Position?

4

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-ThrottleLimit<Int32>

Gibt die maximale Anzahl von gleichzeitigen Vorgängen an, die zum Ausführen dieses Cmdlets eingerichtet werden können. Wenn dieser Parameter ausgelassen oder der Wert 0 eingegeben wird, berechnet Windows PowerShell® einen optimalen Drosselungsgrenzwert für das Cmdlet basierend auf der Anzahl der CIM-Cmdlets, die auf dem Computer ausgeführt werden. Die Drosselungsgrenze gilt nur für das aktuelle Cmdlet und nicht für die Sitzung oder den Computer.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-UserClass<String>

Sets the option value for the specified user class.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

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

Aliasse

Keiner

Erforderlich?

true

Position?

3

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-VendorClass<String>

Sets the option value for the specified vendor class.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-WinsServer<IPAddress[]>

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

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-Wpad<String>

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

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-Confirm

Sie werden vor dem Ausführen des Cmdlets zur Bestätigung aufgefordert.

Erforderlich?

false

Position?

named

Standardwert

falsch

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-WhatIf

Zeigt, was geschieht, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Erforderlich?

false

Position?

named

Standardwert

falsch

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die über die Pipeline an das Cmdlet übergeben werden können.

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

Beispiele

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"

Verwandte Themen

Get-DhcpServerv4OptionValue

Remove-DhcpServerv4OptionValue