DhcpDeleteSubnet function (dhcpsapi.h)
The DhcpDeleteSubnet function deletes a subnet from the DHCP server.
DWORD DHCP_API_FUNCTION DhcpDeleteSubnet( DHCP_CONST WCHAR *ServerIpAddress, DHCP_IP_ADDRESS SubnetAddress, DHCP_FORCE_FLAG ForceFlag );
Unicode string that specifies the IP address of the subnet to delete.
DHCP_IP_ADDRESS value that contains the IP address of the subnet gateway used to identify the subnet.
DHCP_FORCE_FLAG enumeration value that indicates the type of delete operation to perform (full force, failover force, or no force).
This function returns ERROR_SUCCESS upon a successful call. Otherwise, it returns one of the DHCP Server Management API Error Codes.
Usually, you will use either DhcpFullForce or DhcpNoForce as the value for ForceFlag. The DhcpFailoverForce value is intended for use when cleaning up a broken or improperly configured DHCP failover configuration. In that case, use of DhcpFailoverForce ensures that the entire DNS configuration isn't improperly deleted while cleaning up the DHCP failover configuration. Note that the minimum server OS requirement for DhcpFailoverForce is Windows Server 2012 R2 with KB 3100473 installed.
|Minimum supported client||None supported|
|Minimum supported server||Windows 2000 Server [desktop apps only]|