Get-DhcpServerv4OptionValue
Get-DhcpServerv4OptionValue is accessible with the help of DHCPServer module. To configure DHCPServer, go through this link.
Synopsis
Returns the IPv4 option Values for one or more IPv4 options at the server, scope or reservation level.
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.
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, this cmdlet gets all of the option values for a scope, server, or reservation. If the OptionId parameter and this parameter are specified, option values for the specified option identifier (ID) for all of the vendor classes, user classes and policies is returned. If the VendorClass parameter and this parameter are specified, all of the option values for the specified vendor class including those for any user class or policy is returned. If the UserClass parameter and this parameter are specified, all of the option values for the specified user class including any vendor specific options is returned. If the PolicyName parameter and this parameter are specified, all of the option values for the specified policy including any vendor specific options is returned.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AsJob
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job
cmdlets. To get the job results, use the Receive-Job cmdlet. For more information about Windows PowerShell background jobs, see about_Jobs.
Type: | SwitchParameter |
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 by using this cmdlet, we recommend use of the Brief parameter.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-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.
Type: | CimSession[] |
Aliases: | Session |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ComputerName
Specifies the DNS name, or IPv4 or IPv6 address, of the target computer that runs the Dynamic Host Configuration Protocol (DHCP) server service.
Type: | String |
Aliases: | Cn |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OptionId
Specifies the numeric IDs of the options requested.
Type: | UInt32[] |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
-PolicyName
Specifies the name of the policy for which one or more option values are requested.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
-ReservedIP
Specifies the IPv4 address of the reservation for which the option values are requested.
Type: | IPAddress |
Aliases: | IPAddress |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
-ScopeId
Specifies the ID of the scope, in IP address format, for which one or more option values are requested.
Type: | IPAddress |
Position: | 2 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
-ThrottleLimit
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.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserClass
Gets the option values for that user class.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
-VendorClass
Gets the option values for that vendor class.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Syntax
Get-DhcpServerv4OptionValue [-VendorClass <String>] [-ComputerName <String>] [[-ScopeId] <IPAddress>] [-ReservedIP <IPAddress>] [[-OptionId] <UInt32[]>] [-UserClass <String>] [-All] [-Brief] [-PolicyName <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [<CommonParameters>]
—————-EXAMPLE 1—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com
This example gets all the standard DHCPv4 option values, or non-class specific, configured at the server level.
—————-EXAMPLE 2—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ScopeId 192.168.1.0
This example gets all the standard DHCPv4 option values, or non-class specific, configured for the specified scope.
—————-EXAMPLE 3—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ReservedIP 192.168.1.5
This example gets all of the standard DHCPv4 option values, or non-class specific, configured for the specified reservation.
—————-EXAMPLE 4—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ScopeId 192.168.1.0 -VendorClass MSUCClient
This example gets all of the vendor class specific DHCPv4 option values configured on the specified scope for the specified vendor class.
—————-EXAMPLE 5—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ScopeId 192.168.1.0 -OptionId 22
This example gets the DHCPv4 option value configured on the specified scope for the specified option ID.
—————-EXAMPLE 6—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ScopeId 192.168.1.0 -All
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.
—————-EXAMPLE 7—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ScopeId 192.168.1.0 -Brief
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.
—————-EXAMPLE 8—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ScopeId 192.168.1.0 -UserClass firstfloorComputer
This example gets all of the user class specific DHCPv4 option values configured on the specified scope for the specified user class.
—————-EXAMPLE 9—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ScopeId 192.168.1.0 -Policy PrintersPolicy
This example gets all of the standard DHCPv4 option values configured on the specified scope for the specified policy.
—————-EXAMPLE 10—————-
PS C:> Get-DhcpServerv4OptionValue -ComputerName dhcpsrv.TOSSolution.com -ScopeId 192.168.1.0 -Policy PrintersPolicy -VendorClass “HP Printers”
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.
You can check the Version, CommandType and Source of this cmdlet by giving below command.
Get-Command Get-DhcpServerv4OptionValue
You can also read about
- Remove-DhcpServerv4OptionValue
- Set-DhcpServerv4OptionValue
To know more PowerShell cmdlets(Commands) on DHCPServer click here