Get-DhcpServerv4OptionValue
Get-DhcpServerv4OptionValue
Returns the IPv4 option Values for one or more IPv4 options at the server, scope or reservation level.
Syntax
Parameter Set: Get0
Get-DhcpServerv4OptionValue [[-OptionId] <UInt32[]> ] [[-ScopeId] <IPAddress> ] [-All] [-AsJob] [-Brief] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-PolicyName <String> ] [-ReservedIP <IPAddress> ] [-ThrottleLimit <Int32> ] [-UserClass <String> ] [-VendorClass <String> ] [ <CommonParameters>]
Detailed Description
The Get-DhcpServerv4OptionValue cmdlet returns the IPv4 option values for one or more IPv4 options at the server, scope or reservation level. Use the VendorClass and UserClass parameters to get option values for a specific vendor class or for a specific user class. If the OptionId parameter is not specified, then this cmdlet returns the option values for all the options configured at the specified level either the server, the scope, or the reservation level.
If only the ReservedIP parameter is specified, then the option values set at the rReservation level are returned. If only the ScopeId parameter is specified, then the option values set at the scope level are returned. If neither the ScopeId nor the ReservedIP parameter are specified, then option values set at the server level are returned. The ScopeId and ReservedIP parameters cannot both be specified.
If neither the VendorClass nor UserClass parameter is specified, then this cmdlet gets the standard option values set.
The PolicyName and UserClass parameters cannot both be specified.
The PolicyName parameter cannot be specified if the ReservedIP parameter is specified.
Note: The option values for policies only exist for DHCP server services running on Windows Server® 2012. For older versions, only user class based option values exist.
To get legacy user class options, the UserClass parameter must be specified.
Parameters
-All
Gets the option values for a scope, server, or reservation. Option values can include vendor class, user class, and policy specific.
If only this parameter is specified, then this cmdlet will get all of the option values for a scope, server, or reservation.
If the OptionId parameter and this parameter are specified, then option values for the specified option identifier (ID) for all of the vendor classes, user classes and policies will be returned.
If the VendorClass parameter and this parameter are specified, then all of the option values for the specified vendor class including those for any user class or policy would be returned.
If the UserClass parameter and this parameter are specified, then all of the option values for the specified user class including any vendor specific options would be returned.
If the PolicyName parameter and this parameter are specified, then all of the option values for the specified policy including any vendor specific options would be returned.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-AsJob
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Brief
Specifies that the name of the option is not returned in the option value object. This parameter improves the performance of this cmdlet by not requesting the name of the option from the DHCP server service. For repeatedly fetching a large number of option values with this cmdlet use of the Brief parameter is recommended.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CimSession<CimSession[]>
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-OptionId<UInt32[]>
Specifies the numerical IDs of the options being requested.
Aliases |
none |
Required? |
false |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-PolicyName<String>
Specifies the name of the policy for which one or more option values are requested.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ReservedIP<IPAddress>
Specifies the IPv4 address of the reservation for which the option values are requested.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ScopeId<IPAddress>
Specifies the ID of the scope, in IP address format, for which one or more option values are requested.
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ThrottleLimit<Int32>
Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0
is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-UserClass<String>
Gets the option values for that user class.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-VendorClass<String>
Gets the option values for that vendor class.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.Management.Infrastructure.CimInstance#root/Microsoft/Windows/DHCP/DhcpServerv4OptionDefinition
The
Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object.Microsoft.Management.Infrastructure.CimInstance#root/Microsoft/Windows/DHCP/DhcpServerv4Policy
The
Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object.Microsoft.Management.Infrastructure.CimInstance#root/Microsoft/Windows/DHCP/DhcpServerv4Reservation
The
Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object.Microsoft.Management.Infrastructure.CimInstance#root/Microsoft/Windows/DHCP/DhcpServerv4Scope
The
Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.Management.Infrastructure.CimInstanceroot/Microsoft/Windows/DHCP/DhcpServerv4OptionValue[]
The
Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object.
Examples
EXAMPLE 1
This example gets all the standard DHCPv4 option values, or non-class specific, configured at the server level.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com
EXAMPLE 2
This example gets all the standard DHCPv4 option values, or non-class specific, configured for the specified scope.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0
EXAMPLE 3
This example gets all of the standard DHCPv4 option values, or non-class specific, configured for the specified reservation.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ReservedIP 10.10.10.5
EXAMPLE 4
This example gets all of the vendor class specific DHCPv4 option values configured on the specified scope for the specified vendor class.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -VendorClass MSUCClient
EXAMPLE 5
This example gets the DHCPv4 option value configured on the specified scope for the specified option ID.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -OptionId 23
EXAMPLE 6
This example gets all of the DHCPv4 option values, including standard as well as vendor class or user class specific, configured on the specified scope.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -All
EXAMPLE 7
This example gets all of the standard DHCPv4 option values configured on the specified scope. The object that is returned does not contain the name of the option. The Brief parameter increase the performance by removing the delay required to get the name of the option from the DHCP server service.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -Brief
EXAMPLE 8
This example gets all of the user class specific DHCPv4 option values configured on the specified scope for the specified user class.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -UserClass LabComputer
EXAMPLE 9
This example gets all of the standard DHCPv4 option values configured on the specified scope for the specified policy.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -Policy SmartPhonePolicy
EXAMPLE 10
This example gets all of the standard, or non-class specific, DHCPv4 option values configured on the specified scope for the specified policy and vendor class.
PS C:\> Get-DhcpServerv4OptionValue -ComputerName dhcpserver.contoso.com -ScopeId 10.10.10.0 -Policy SmartPhonePolicy -VendorClass "HTC Phone"