Add method of the PS_DhcpServerv4Lease class
Adds a new IPv4 address lease in the DHCP server.
Syntax
uint32 Add(
[in] string IPAddress,
[in] string ScopeId,
[in] string ClientId,
[in] string AddressState,
[in] string HostName,
[in] string Description,
[in] string ComputerName,
[in] boolean PassThru,
[in] string DnsRR,
[in] string DnsRegistration,
[in] string ClientType,
[in] datetime LeaseExpiryTime,
[in] boolean NapCapable,
[in] string NapStatus,
[in] datetime ProbationEnds,
[in] string PolicyName,
[out] DhcpServerv4Lease cmdletOutput
);
Parameters
-
IPAddress [in]
-
IP Address for which the IP address lease record is to be added on the DHCP server
-
ScopeId [in]
-
Subnet mask to be set on the IP address lease record being added
-
ClientId [in]
-
Client identifier to be set on the IP address lease
-
AddressState [in]
-
State of the IP Address lease. Valid values are Offered, Active, Declined, Expired, Inactive. Default value is Active.
-
Offered (Offered)
-
Active ("Active")
-
Declined ("Declined")
-
Expired ("Expired")
-
ActiveReservation ("ActiveReservation")
-
InactiveReservation ("InactiveReservation")
HostName [in]
DNS hostname of the client for which the IP address lease is to be added
Description [in]
Description string to be set on the IP address lease
ComputerName [in]
DNS name or IP address of the target computer running the DHCP server service.
PassThru [in]
If this parameter is specified, the cmdlet return the PowerShell objects which are deleted.
DnsRR [in]
Indicates the type of DNS record to be registered by the DHCP server for the lease.
A ("A")
PTR ("PTR")
AandPTR ("AandPTR")
NoRegistration ("NoRegistration")
Windows Server 2012: This parameter supports the A value beginning with Windows Server 2012 R2.
DnsRegistration [in]
Indicates status of the DNS registration of the lease.
Complete ("Complete")
Pending ("Pending")
NotApplicable ("NotApplicable")
ClientType [in]
Type of the client. Valid values are UNSPECIFIED, DHCP, BOOTP, BOTH, RESERVATION, NONE.
UnSpecified ("UnSpecified")
Dhcp ("Dhcp")
BootP ("BootP")
None ("None")
LeaseExpiryTime [in]
Expiry time of the IP address lease
NapCapable [in]
Indicate if the client is NAP capable or not. Valid values are True, False.
NapStatus [in]
NAP status of the client. Valid values are NOQUARANTINE, RESTRICTEDACCESS, DROPPACKET, PROBATION, EXEMPT, DEFAULTQUARSETTING, and NOQUARINFO. The default value is NOQUARANTINE.If NapStatus is specified as PROBATION and probation period is not specified, cmdlet will return an error. If NapStatus is not specified or is specified something other than Probation and probation period is not specified, the probation period to set to 0. If NapStatus is not specified and probation period is specified, the NapStatus is set to PROBATION. If NapStatus is not specified or specified other than Probation AND ProbationEnds is specified, cmdlet will return an error.
FullAccess ("FullAccess")
RestrictedAccess ("RestrictedAccess")
DropPacket ("DropPacket")
InProbation ("InProbation")
Exempt ("Exempt")
DefaultQuarantineSetting ("DefaultQuarantineSetting")
NoQuarantineInfo ("NoQuarantineInfo")
ProbationEnds [in]
End-time of probation to be set on the IP address lease record. Default value is 0.
PolicyName [in]
Name of the policy to be set on the IP address lease record being added. Note: DHCP server does not perform any check on whether the policy specified exists on the server.
cmdletOutput [out]
An embedded instance of the DhcpServerv4Lease class.
Requirements
Minimum supported client |
None supported |
Minimum supported server |
Windows Server 2012 |
Namespace |
Root\Microsoft\Windows\DHCP |
MOF |
|
DLL |
|