Expand Minimize

DhcpV4DeletePolicy function

The DhcpV4DeletePolicy function deletes an existing policy from the DHCP Server.

Syntax


DWORD DHCP_API_FUNCTION DhcpV4DeletePolicy(
  _In_opt_  LPWSTR ServerIpAddress,
  _In_      BOOL fGlobalPolicy,
  _In_      DHCP_IP_ADDRESS SubnetAddress,
  _In_      LPWSTR PolicyName
);

Parameters

ServerIpAddress [in, optional]

Pointer to a null-terminated Unicode string that represents the IP address or hostname of the DHCP server.

fGlobalPolicy [in]

If TRUE the server level policy is deleted. Otherwise, the scope level policy is deleted.

SubnetAddress [in]

DHCP_IP_ADDRESS structure that contains the IPv4 subnet address of the policy to delete.

PolicyName [in]

A null-terminated Unicode string that represents the name of the policy to delete.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, it returns one of the following error codes.

ValueMeaning
ERROR_DHCP_SUBNET_NOT_PRESENT

The specified IPv4 subnet does not exist.

ERROR_DHCP_POLICY_NOT_FOUND

The DHCP server policy was not found.

ERROR_INVALID_PARAMETER

The parameters were invalid.

 

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Dhcpsapi.h

Library

Dhcpsapi.lib

DLL

Dhcpsapi.dll

See also

DhcpV4AddPolicyRange
DhcpV4CreatePolicy
DhcpV4EnumPolicies
DhcpV4GetPolicy
DhcpV4QueryPolicyEnforcement
DhcpV4RemovePolicyRange
DhcpV4SetPolicy
DhcpV4SetPolicyEnforcement

 

 

Community Additions

ADD
Show:
© 2014 Microsoft