The GetPoliciesForServerByServerId procedure retrieves all the DHCP policies that are associated with a specific DHCP server.
The following input parameter is used.
Param_serverId: This is a signed 64-bit integer that represents a RecordId for a DhcpServerv4.
The following is the output parameter from this procedure.
Result_serverPolicies: This is a collection of type DhcpPolicyv4 instances that have the same value in the server column of the row as specified by Param_serverId.
The following steps are involved:
Enumerate the rows in ADM_DhcpPolicyTable having Server equal to Param_serverId and Level equal to PolicyLevel.serverLevel.
For each row meeting the criteria mentioned in step 1, perform the following steps:
Create an instance of DhcpPolicyV4 with the following assignments:
Set DhcpPolicyV4.PolicyId to the PolicyId of the row.
Copy the PolicyDetails to the DhcpPolicyV4 instance.
Initialize DhcpPolicyV4.Server with DhcpServerV4.
Set DhcpPolicyV4.Server.RecordId to the Server of the row.
Initialize DhcpPolicyV4.ServerRecordId with the Server of the row.
Add the DhcpPolicyV4 instance to Result_serverPolicies collection.
Return Result_scopePolicies as the output of the procedure.