DhcpServerSetConfig function (dhcpsapi.h)
The DhcpServerSetConfig function configures a DHCPv4 server with specific settings, including information on the JET database used to store subnet and client lease information, and the supported protocols.
Syntax
DWORD DHCP_API_FUNCTION DhcpServerSetConfig(
[in] DHCP_CONST WCHAR *ServerIpAddress,
[in] DWORD FieldsToSet,
[in] LPDHCP_SERVER_CONFIG_INFO ConfigInfo
);
Parameters
[in] ServerIpAddress
Unicode string that specifies the IP address or hostname of the DHCP server.
[in] FieldsToSet
Specifies a set of bit flags that indicate which fields in ConfigInfo are set. If a flag is present, the corresponding field must also be populated in the DHCP_SERVER_CONFIG_INFO structure referenced by ConfigInfo, and will be used to set the same value on the DHCP server,
[in] ConfigInfo
DHCP_SERVER_CONFIG_INFO structure that contains the specific configuration information to set on the DHCP server, as indicated by the flags specified in FieldsToSet.
Return value
This function returns ERROR_SUCCESS upon a successful call. Otherwise, it returns one of the DHCP Server Management API Error Codes.
Remarks
The DHCPv4 server must be restarted for the following settings to be effective:
- Set_APIProtocolSupport
- Set_DatabaseName
- Set_DatabasePath
- Set_DatabaseLoggingFlag
- Set_RestoreFlag
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | dhcpsapi.h |
Library | Dhcpsapi.lib |
DLL | Dhcpsapi.dll |