COMMAND EVERYTHING.
Adds a new IPv4 address lease in the DHCP server service.
Microsoft DhcpServer reference: Adds a new IPv4 address lease in the DHCP server service. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for Add-DhcpServerv4Lease. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Windows / DhcpServer · Windows Server 2025 documentation; feature/module prerequisites apply
-AddressState- Specifies the state of the IPv4 Address lease. The acceptable values for this parameter are: Offered, Active, Declined, Expired, and Inactive. The default value is Active.
-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.
-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.
-ClientId (required)- Specifies the client identifier (ID) to be set on the IPv4 address lease. Windows clients use the MAC address as the client ID.
-ClientType- Specifies the type of the client. The acceptable values for this parameter are: Unspecified, DHCP, BootP, Both, Reservation, and None.
-ComputerName- Specifies the DNS name, or IPv4 or IPv6 address, of the target computer that runs the DHCP server service.
-Confirm- Prompts you for confirmation before running the cmdlet.
-Description- Specifies the description string to be set on the IPv4 address lease.
-DnsRR- Indicates the type of DNS record to be registered by the DHCP server service for this lease. The acceptable values for this parameter are: - PTR. Only PTR record to be registered by the DHCP server service. - AandPTR. Both A and PTR records to be registered by the DHCP server service. - NoRegistration. No DNS registration is performed by the DHCP server service. If the dynamic DNS is turned off on the DHCP server service, this parameter is set to NoRegistration.
-DnsRegistration- Indicates the status of the DNS registration of the lease. The acceptable values for this parameter are: - Complete. - For an active lease, registration of the required records, as specified by the *DnsRR* parameter value of PTR or AandPTR, is complete. - For an expired lease, deletion of the required records is complete. - Pending. - For an active lease, registration of the required records, as specified by the *DnsRR* parameter value of PTR or AandPTR, is pending. - For an expired lease, deletion of the required records is pending. - Not applicable. - If the *DnsRR* parameter is set to NoRegistration, such as when no dynamic DNS registration is to be performed by the DHCP server service, this parameter is set to Not applicable.
-HostName- Specifies the DNS host name of the client for which the IP address lease to add.
-IPAddress (required)- Specifies the IPv4 address for which the IPv4 address lease record to add on the DHCP server service.
-LeaseExpiryTime- Specifies the expiry time of the IPv4 address lease.
-NapCapable- Indicates that the client is network access protection (NAP) capable.
-NapStatus- Specifies the NAP status of the client. The acceptable values for this parameter are: NoQuarantine, RestrictedAccess, DropPacket, Probation, Exempt, DefaultQuarSetting, and NoQuarInfo. The default value is NoQuarantine. If you specify this parameter as Probation and a probation period is not specified, this cmdlet returns an error. If you do not specify this parameter or specified it as something other than Probation and probation period is not specified, the probation period to set to 0. If you do not specify this parameter and a probation period is specified, this parameter is set to Probation. If you do not specify this parameter or specify it something other than Probation and the *ProbationEnds* parameter is specified, this cmdlet returns an error.
-PassThru- Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
-PolicyName- Specifies the name of the policy to be set on the IPv4 address lease record that is added. The DHCP server service does not check whether the policy specified exists on the server.
-ProbationEnds- Specifies the end-time of probation to be set on the IPv4 address lease record.
-ScopeId (required)- Specifies the subnet mask to be set on the IPv4 address lease record that is added.
-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.
-WhatIf- Shows what would happen if the cmdlet runs. The cmdlet is not run.
Windows with the DhcpServer module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.