Site icon TOSS

Add-DhcpServerv4Failover

powershell

Add-DhcpServerv4Failover is accessible with the help of DHCPServer module. To configure DHCPServer, go through this link.

Synopsis

Adds a new IPv4 failover relationship on the Dynamic Host Configuration Protocol (DHCP) server service.

Description

The Add-DhcpServerv4Failover cmdlet adds a new IPv4 failover relationship to a Dynamic Host Configuration Protocol (DHCP) server service. The first parameter set adds a failover relationship with load balance mode. The second parameter set adds the failover relationship in hot-standby mode.

This cmdlet creates the failover relationship on both of the DHCP server services with the specified parameters. The ScopeId parameter value specified on the source DHCP server service, or local computer running the DHCP server service is identically setup on the partner DHCP server service.

If the SharedSecret parameter is specified, message digest authentication will be automatically turned on for the newly created failover relationship.

By default, user confirmation will be sought if the SharedSecret parameter is specified.

Parameters

-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

-AutoStateTransition

Specifies the enabled state for automatic state transition from the COMMUNICATION INTERRUPTED state to the PARTNER DOWN state based on expiration of the timer, using the StateSwitchInterval parameter, while in the COMMUNICATION INTERRUPTED state.

The acceptable values for this parameter are: True or False. The default value is False.

If the StateSwitchInterval parameter is specified, this parameter is automatically set to True.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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 DHCP server service.

Type:String
Aliases:Cn
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Specifies that, if the SharedSecret parameter is specified, the user confirmation is required because the SharedSecret parameter value may be transferred in plain text transport for remote management. Specifying this parameter turns off the user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-LoadBalancePercent

Specifies the percentage of DHCP client requests which should be served by the local DHCP server service or the DHCP server service that runs on the computer specified in the ComputerName parameter. The remaining requests would be served by the partner DHCP server service.

The default value is 50%.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-MaxClientLeadTime

Specifies the maximum client lead time for the failover relationship. The default value is 1 hour.

Type:TimeSpan
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

-Name

Specifies the name of the failover relationship to create.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

-PartnerServer

Specifies the IPv4 address, or host name, of the partner DHCP server service with which the failover relationship is created.

Type:String
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ReservePercent

Specifies the percentage of free IPv4 addresses in the IPv4 address pool of the scope which should be reserved on the standby DHCP server service. In the case of a failover, the IPv4 address from this reserved pool on the standby DHCP server service will be leased to new DHCP clients. The default value is 5.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ScopeId

Specifies the scope identifiers, in IPv4 address format, which are to be added to the failover relationship.

Type:IPAddress[]
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

-ServerRole

Specifies the role of the local DHCP server service in the hot standby mode. The acceptable values for this parameter are: Active or Standby. The default value is Active for the local DHCP server service, such as the partner DHCP server service that is specified will be a standby DHCP server service.

Type:String
Accepted values:Active, Standby
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-SharedSecret

Specifies the shared secret to be used for message digest authentication. If not specified, the message digest authentication is turned off.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-StateSwitchInterval

Specifies the time interval for which the DHCP server service operates in the COMMUNICATION INTERRUPTED state before transitioning to the PARTNER DOWN state.

Type:TimeSpan
Position:Named
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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Syntax

Add-DhcpServerv4Failover [-ComputerName <String>] [-Name] <String> [-PartnerServer] <String> [-ScopeId] <IPAddress[]> [-MaxClientLeadTime <TimeSpan>] [-AutoStateTransition <Boolean>] [-StateSwitchInterval <TimeSpan>] [-Force] [-SharedSecret <String>] [-PassThru] [-LoadBalancePercent <UInt32>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]

Add-DhcpServerv4Failover [-ComputerName <String>] [-Name] <String> [-PartnerServer] <String> [-ScopeId] <IPAddress[]> [-MaxClientLeadTime <TimeSpan>] [-AutoStateTransition <Boolean>] [-StateSwitchInterval <TimeSpan>] [-Force] [-SharedSecret <String>] [-PassThru] [-ReservePercent <UInt32>] [-ServerRole <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]

———————-EXAMPLE 1———————-
PS C:> Add-DhcpServerv4Failover -ComputerName dhcpsrv.TOSSolution.com -Name SFO-SIN-Failover -PartnerServer dhcpsrvsec.TOSSolution.com -ScopeId 192.168.1.0,192.168.2.0 -SharedSecret “sEcReT”
This example creates a load balance, or active-active, failover relationship between the DHCP server services running on the computers named dhcpsrv.TOSSolution.com and dhcpsrvsec.TOSSolution.com with the scopes 192.168.1.0 and 192.168.2.0 present on the DHCP server service running on the computer named dhcpsrv.TOSSolution.com added to the failover relationship. These scopes will be created on the partner DHCP server service running on the computer named dhcpsrvsec.TOSSolution.com as part of the failover relationship creation. Message authentication is enabled for the server-to-server message exchange with the specified shared secret.

———————-EXAMPLE 2———————-
PS C:>Add-DhcpServerv4Failover -ComputerName dhcpsrv.TOSSolution.com -Name SFO-SIN-Failover -PartnerServer dhcpsrvsec.TOSSolution.com -ServerRole Standby -ScopeId 192.168.1.0,192.168.2.0
This example creates a hot standby, or active-passive, failover relationship between the DHCP server services running on the computers named dhcpsrv.TOSSolution.com and dhcpsrvsec.TOSSolution.com with the scopes 192.168.1.0 and 192.168.2.0 present on the DHCP server service running on the computer named dhcpsrv.TOSSolution.com added to the failover relationship. These scopes will be created on the partner DHCP server service running on the computer named dhcpsrvsec.TOSSolution.com as part of the failover relationship creation. The DHCP server service running on the computer named dhcpsrv.TOSSolution.com will be the standby DHCP server service and the DHCP server service running on the computer named dhcpsrvsec.TOSSolution.com will be the active DHCP server service in the failover relationship.

———————-EXAMPLE 3———————-
PS C:>Add-DhcpServerv4Failover -ComputerName dhcpsrv.TOSSolution.com -Name SFO-SIN-Failover -PartnerServer dhcpsrvsec.TOSSolution.com -ScopeId 192.168.1.0,192.168.2.0 -LoadBalancePercent 80 -MaxClientLeadTime 4:00:00 -AutoStateTransition $true -StateSwitchInterval 4:00:00
This example creates a load balance, or active-active, failover relationship between the DHCP server services running on the computer named dhcpsrv.TOSSolution.com and dhcpsrvsec.TOSSolution.com with the scopes 192.168.1.0 and 192.168.2.0 present on the DHCP server service running on the computer named dhcpsrv.TOSSolution.com added to the failover relationship. These scopes will be created on the partner DHCP server service running on the computer named dhcpsrvsec.TOSSolution.com as part of the failover relationship creation. 80% of the client requests will be served by DHCP server service running on the computer named dhcpsrv.TOSSolution.com and 20% by the DHCP server service running on the computer named dhcpsrvsec.TOSSolution.com. The maximum client lead time for the failover relationship is set to 4 hours. The automatic state transition from the COMMUNICATION INTERRUPTED state to the PARTNER DOWN state is turned on and the timer for automatic state transition is set to 4 hours.

———————-EXAMPLE 4———————-
PS C:>Add-DhcpServerv4Failover -ComputerName dhcpsrv.TOSSolution.com -Name SFO-SIN-Failover -PartnerServer dhcpsrvsec.TOSSolution.com -ScopeId 192.168.1.0,192.168.2.0 -ReservePercent 20 -MaxClientLeadTime 3:00:00 -AutoStateTransition $true -StateSwitchInterval 3:00:00
This example creates a hot standby, or Active-Passive, failover relationship between the DHCP server service running on the computer named dhcpsrv.TOSSolution.com and dhcpsrvsec.TOSSolution.com with the scopes 192.168.1.0 and 192.168.2.0 present on the DHCP server service running on the computer named dhcpsrv.TOSSolution.com added to the failover relationship. These scopes will be created on the partner DHCP server service running on the computer named dhcpsrvsec.TOSSolution.com as part of the failover relationship creation. The DHCP server service running on the computer named dhcpsrvsec.TOSSolution.com will be standby DHCP server service and the DHCP server service running on the computer named dhcpsrv.TOSSolution.com will be the active DHCP server service in the failover relationship. 20% of the free IP addresses in the scopes will be reserved for the standby DHCP server service. The maximum client lead time for the failover relationship is set to 3 hours. The automatic state transition from the COMMUNICATED INTERUPTED state to the PARTNER DOWN state is turned on and the timer for automatic state transition is set to 3 hours.

You can check the Version, CommandType and Source of this cmdlet by giving below command.

Get-Command Add-DhcpServerv4Failover

You can also read about

To know more PowerShell cmdlets(Commands) on DHCPServer click here

Click on this Link for an Single place where you get all the PowerShell cmdlet sorted based on the modules.

You can also refer other blogs on PowerShell at link

You can also refer other blogs on Microsoft at link

And also if you required any technology you want to learn, let us know below we will publish them in our site http://tossolution.com/

Like our page in Facebook and follow us for New technical information.

References are taken from Microsoft

Exit mobile version