Expand Minimize

DhcpServerSetConfigV4 function

The DhcpServerSetConfigV4 function configures a DHCP 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 DhcpServerSetConfigV4(
  _In_  DHCP_CONST WCHAR *ServerIpAddress,
  _In_  DWORD FieldsToSet,
  _In_  LPDHCP_SERVER_CONFIG_INFO_V4 ConfigInfo
);

Parameters

ServerIpAddress [in]

Unicode string that specifies the IP address or hostname of the DHCP server.

FieldsToSet [in]

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_V4 structure referenced by ConfigInfo, and will be used to set the same value on the DHCP server,

ValueMeaning
Set_APIProtocolSupport
0x00000001

The APIProtocolSupport field is populated.

Set_DatabaseName
0x00000002

The DatabaseName field is populated.

Set_DatabasePath
0x00000004

The DatabasePath field is populated.

Set_BackupPath
0x00000008

The BackupPath field is populated.

Set_BackupInterval
0x00000010

The BackupInterval field is populated.

Set_DatabaseLoggingFlag
0x00000020

The DatabaseLoggingFlag field is populated.

Set_RestoreFlag
0x00000040

The RestoreFlag field is populated.

Set_DatabaseCleanupInterval
0x00000080

The DatabaseCleanupInterval field is populated.

Set_DebugFlag
0x00000100

The DebugFlag field is populated.

Set_PingRetries
0x00000200

The PingRetries field is populated.

Set_BootFileTable
0x00000400

The BootFileTable field is populated.

Set_AuditLogState
0x00000800

The AuditLogState field is populated.

 

ConfigInfo [in]

DHCP_SERVER_CONFIG_INFO_V4 structure that contains the specific DHCP server configuration settings as indicated by the bit flags set 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.

Return codeDescription
ERROR_ACCESS_DENIED

This call was performed by a client who is not a member of the "DHCP Administrators" security group.

ERROR_DHCP_JET_ERROR

An error occurred while accessing the DHCP server's database.

ERROR_INVALID_PARAMETER

One of the parameters provides an invalid value.

 

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Dhcpsapi.h

Library

Dhcpsapi.lib

DLL

Dhcpsapi.dll

See also

DhcpServerGetConfigV4
DHCP_SERVER_CONFIG_INFO_V4

 

 

Community Additions

ADD
Show:
© 2014 Microsoft