Microsoft DHCP
Technical Information Available in Community Cloud Enterprise
Copy Markdown
Microsoft DHCP Object NetBox Object Notes DHCP Scope PrefixOne prefix per scope; status = reserved; is_pool = true; mark_utilized = true Exclusion Range IPRangeOne IP range per exclusion range; status = reserved Reservation IPAddressstatus = reserved; always syncedLease IPAddressstatus = dhcp; opt-in per scope via MSFT_DHCP_LEASE_SCOPE_IDS
NetBox Field Source Notes prefixScopeId + SubnetMaskCIDR calculated from scope network address and subnet mask statusStatic Always reserved is_poolStatic Always true mark_utilizedStatic Always true descriptionStatic Microsoft DHCP - DHCP Scope - {host}custom_fieldsScope metadata + options See custom fields table below
NetBox Field Source Notes start_addressStartRangeCIDR notation using the prefix length from the parent scope end_addressEndRangeCIDR notation using the prefix length from the parent scope statusStatic Always reserved descriptionStatic Microsoft DHCP - Exclusion range in scope {scope_id} - {host}
NetBox Field Source Notes addressIPAddressCIDR notation derived from parent scope subnet mask statusStatic Always reserved descriptionNameMicrosoft DHCP - {host}, Reservation for {Name}
NetBox Field Source Notes addressIPAddressCIDR notation derived from parent scope subnet mask statusStatic Always dhcp descriptionHostNameMicrosoft DHCP - {host}, Leased IP for {HostName}
When a reservation and a lease exist for the same IP address, the reservation always takes precedence. The IP address is ingested with status reserved using the reservation data.
The following custom fields are created during bootstrap mode and applied to Prefix objects:
Custom Field Name Label Type Description dhcp_serverDHCP Server text Source DHCP server hostname or IP that this scope was synced from msft_dhcp_scope_nameMS DHCP Scope Name text Microsoft DHCP scope display name msft_dhcp_scope_stateMS DHCP Scope State text Microsoft DHCP scope state (e.g. Active, Inactive) msft_dhcp_scope_start_rangeMS DHCP Scope Start Range text First address in the Microsoft DHCP scope range msft_dhcp_scope_end_rangeMS DHCP Scope End Range text Last address in the Microsoft DHCP scope range msft_dhcp_lease_duration_secondsMS DHCP Lease Duration (seconds) integer Microsoft DHCP scope lease duration in seconds msft_dhcp_optionsMS DHCP Options JSON Microsoft DHCP scope-level option values as reported by Get-DhcpServerv4OptionValue. List of objects with OptionId, Name, Type, Value.
All custom fields are read-only in the NetBox UI (ui_editable: no).
[
{ "Name" : "DNS Servers" , "OptionId" : 6 , "Type" : "IPv4Address" , "Value" : [ "192.168.0.1" ]},
{ "Name" : "Router" , "OptionId" : 3 , "Type" : "IPv4Address" , "Value" : [ "192.168.0.254" ]},
{ "Name" : "Lease" , "OptionId" : 51 , "Type" : "DWord" , "Value" : [ "691200" ]}
]
All entities ingested by the Microsoft DHCP integration are tagged with:
Tag Applied To Description microsoftAll entities Applied to all objects from this integration dhcpAll entities Identifies objects sourced from a DHCP server discoveredAll entities Standard tag applied to all controller integration objects msft-dhcp-{host}All entities Unique per-agent tag identifying the source DHCP server; e.g., msft-dhcp-dhcp-server.corp.example.com
Parameter Type Default Description MSFT_DHCP_HOSTstring required Windows DHCP Server hostname or IP address MSFT_DHCP_USERNAMEstring required WinRM service account (typically DOMAIN\username) MSFT_DHCP_PASSWORDstring required WinRM service account password MSFT_DHCP_USE_SSLbool trueUse HTTPS WinRM on port 5986; set false for HTTP on port 5985 MSFT_DHCP_PORTint 5986 / 5985Override the default WinRM port MSFT_DHCP_VERIFY_SSLbool falseVerify the WinRM TLS certificate; off by default as Windows servers commonly use self-signed certificates MSFT_DHCP_LEASE_SCOPE_IDSstring unset Comma-separated list of scope IDs (network addresses) for which leases are synced; e.g., 192.168.0.0,10.0.1.0 BOOTSTRAPbool falseWhen true, emits only custom field definitions with no DHCP server connection required
The integration uses the pypsrp library to connect over WinRM/PSRP with NTLM authentication. The following PowerShell cmdlets are executed on the target server:
Cmdlet Purpose Get-DhcpServerv4ScopeRetrieves all DHCP scopes Get-DhcpServerv4LeaseRetrieves leases; called only for scopes listed in MSFT_DHCP_LEASE_SCOPE_IDS Get-DhcpServerv4ReservationRetrieves all reservations across all scopes Get-DhcpServerv4OptionValueRetrieves per-scope DHCP option values Get-DhcpServerv4ExclusionRangeRetrieves exclusion ranges for each scope