PowerShell Commands- Configuring DHCP and IPAM

When talking about PowerShell commands for DHCP, I must let you know that there are dozens of commands that you can use to configure and maintain a DHCP server. Table 6.1 shows just some of the possible PowerShell commands that are available for DHCP.

The following table lists just some of the PowerShell commands available for DHCP. To see the complete list, visit Microsoft’s website at https:// docs.microsoft.com/en- us/powershell/module/dhcpserver/?view= windowsserver2019- ps.

TABLE 6.1 DHCP PowerShell commands

Add- DhcpServerInDCThis command allows you to authorize the DHCP server services in Active Directory.
Add- DhcpServerv4ClassThis command allows you to add an IPv4 vendor or user class.
Add- DhcpServerv4ExclusionRangeYou can use this command to add an exclusion range to an IPv4 scope.
Add- DhcpServerv4FailoverYou can use this command to add an IPv4 failover.
Add- DhcpServerv4LeaseThis command allows you to add a new IPv4 address lease.
Add- DhcpServerv4MulticastScopeYou use this command to add a multicast scope server.
Add-  DhcpServerv4OptionDefinitionThis command allows you to add a DHCPv4 option definition.
Add- DhcpServerv4PolicyYou can use this command to add a new policy to either the server or scope level.
Add- DhcpServerv4ReservationThis command allows you to reserve a client IPv4 address in the scope.
Add- DhcpServerv4ScopeThis command adds an IPv4 scope.
Add- DhcpServerv6ClassThis command allows you to add an IPv6 vendor or user class.
Add- DhcpServerv6ExclusionRangeYou can use this command to add an exclusion range to an IPv6 scope.
Add- DhcpServerv6LeaseThis command allows you to add a new IPv6 address lease.
Add- DhcpServerv6OptionDefinitionThis command allows you to add a DHCPv6 option definition.
Add- DhcpServerv6ReservationThis command allows you to reserve a client IPv6 address in the scope.
Add- DhcpServerv6ScopeThis command adds an IPv6 scope.
CommandDescription
Backup- DhcpServerYou can use this command to back up the DHCP database.
Export- DhcpServerThis command allows you to export the DHCP server configuration and lease data.
Get- DhcpServerAuditLogThis command shows you the audit log for the DHCP configuration.
Get- DhcpServerDatabaseYou can use this command to view the configuration parameters of the DHCP database.
Get- DhcpServerSettingThis command allows you to view the configuration parameters of the DHCP database.
Get- DhcpServerv4ClassYou use this command to view the IPv4 vendor or user class settings.
Set- DhcpServerDatabaseThis command allows you to modify configuration settings of the DHCP database.
Set- DhcpServerDnsCredentialYou can set the credentials of the DHCP Server service, which help register or deregister client records.
Set- DhcpServerSettingThis command allows you to configure the server- level settings.
Set- DhcpServerv4ClassThis command allows you to configure the IPv4 vendor class or user class settings.
Set- DhcpServerv4FailoverThis command allows you to configure the settings for an existing failover relationship.
Set- DhcpServerv4PolicyYou can use this command to configure the settings of a DHCP policy.
Set- DhcpServerv4ReservationThis command allows you to configure an IPv4 reservation.
Set- DhcpServerv4ScopeYou can use this command to configure the settings of an existing IPv4 scope.
Set- DhcpServerv6ReservationThis command allows you to configure an IPv4 reservation.
Set- DhcpServerv6ScopeYou can use this command to configure the settings of an existing IPv6 scope.

Table 6.2 shows some of the possible PowerShell commands for IPAM.

For a complete list of IPAM PowerShell commands, please visit Microsoft’s website at https://technet.microsoft.com/en- us/itpro/ powershell/windows/ipamserver/ipamserver.

TABLE 6.2 PowerShell commands for IPAM

Add- IpamAddressThis command allows you to add an IP address to IPAM.
Add- IpamAddressSpaceThis command allows you to add an address space to IPAM.
Add- IpamBlockYou can use this command to add an IP address block to IPAM.
Add- IpamCustomFieldThis command is used to add a custom field to IPAM.
Add- IpamCustomValueYou can use this command to add an IPAM value to a custom field.
Add- IpamDiscoveryDomainThis command allows you to add a new domain in which IPAM discovers infrastructure servers.
Add- IpamRangeYou can use this command to add an IP address range to an IPAM server.
Disable- IpamCapabilityThis command allows you to disable an IPAM optional capability.
Enable- IpamCapabilityThis command allows you to enable an IPAM optional capability.
Export- IpamAddressYou can use this command to export IP addresses from an IPAM server.
Export- IpamRangeYou can use this command to export all of the IP address ranges.
Export- IpamSubnetThis command allows you to export the subnets of an IP address.
Find- IpamFreeAddressThis command will show you the available subnets for allocation, given an IP block, prefix length, and number of requested subnets.
Get- IpamAddressThis command shows you a requested IP addresses from IPAM.
Get- IpamAddressSpaceThis command shows you address spaces in IPAM.
Get- IpamBlockThis command shows you a set of address blocks from IPAM.
Get- IpamDatabaseYou can use this command to view the IPAM database configuration settings.
Get- IpamDhcpScopeYou can use this command to view DHCP scopes on an IPAM server.
Get- IpamDhcpServerThis command allows you to view DHCP server information from IPAM database.
Get- IpamDnsResourceRecordYou can use this command to view DNS resource records in an IPAM database.
Get- IpamDnsServerThis command allows you to view DNS server information from IPAM database.
Get- IpamDnsZoneThis command allows you to view DNS zone information from IPAM database.
Get-  IpamIpAddressAuditEventYou can use this command to view IP address audit events in IPAM.
Import- IpamAddressThis command allows you to import an IP address into the IPAM server.
Import- IpamRangeThis command allows you to import an IP address range into the IPAM server.
Import- IpamSubnetThis command allows you to import an IP address subnet into the IPAM server.
Invoke-  IpamGpoProvisioningYou can create and links IPAM Group Policy Objects (GPOs) for provisioning.

TABLE 6.2 PowerShell commands for IPAM (Continued)

CommandDescription
Move- IpamDatabaseThis command allows you to move an IPAM database to a SQL server database.
Remove- IpamAddressYou use this command on an IPAM server to remove a set of IP addresses.
Remove- IpamAddressSpaceYou use this command on an IPAM server to remove a set of IP address spaces.
Set- IpamAccessScopeThis command allows you to set up an IPAM access scope.
Set- IpamAddressYou can use this command to configure an IP address in IPAM.
Set- IpamAddressSpaceYou can use this command to configure an IP address space in IPAM.
Set- IpamBlockYou can use this command to configure an IP address block in IPAM.
Set- IpamConfigurationYou can adjust the configuration of a computer that hosts the IPAM server.
Set- IpamDatabaseThis command allows you to change the settings on how IPAM connects to the IPAM database.
Set- IpamDiscoveryDomainYou use this command to change the IPAM discovery configuration.
Set- IpamRangeThis command is used to modify an existing IP address range.
Set- IpamSubnetThis command is used to modify an existing IP subnet.
Update- IpamServerYou can use this command to update the IPAM server after an operating system upgrade.

Exam Essentials

Summary

In this chapter, I explained how DHCP can help your company by issuing all of the TCP/IP settings to your corporate clients. There are two ways to set up a TCP/IP network: manually or automatic. Manually means that you need to set up the TCP/IP for each client. Automatic means that your corporate clients get their TCP/IP settings from DHCP.

This chapter covered the DHCP lease process as it relates to TCP/IP configuration information for clients. The following stages were covered: IP discovery, IP lease offer, IP lease selection, and IP lease acknowledgment. I showed you how to install and configure the DHCP server on Windows Server 2022 and how to create and manage DHCP scopes and scope options.

I also discussed the authorization of DHCP servers within Active Directory and scopes for IPv4 and IPv6, and then I showed you how to create them. I also covered superscopes as well as managing client leases with their options.

In this chapter, I showed you how to install and configure IPAM. I explained how you need to set up the required GPOs using PowerShell and the different types of role- based administration IPAM allows.

Understanding how DHCP, DNS, and IPAM all work together is essential for ensuring success when taking the exam. Focus your attention on completing the exercises found within the chapter and learning the ins and outs of managing TCP/IP services using IPAM administration.

Exam Essentials

Know how to install and authorize a DHCP server. You install the DHCP service using the Add/Remove Windows Components Wizard. You authorize the DHCP server using the DHCP snap- in. When you authorize a server, you’re actually adding its IP address to the Active Directory object that contains a list of the IP addresses of all authorized DHCP servers.

Know how to create a DHCP scope. You use the New Scope Wizard to create a new scope for both IPv4 and IPv6. Before you start, you’ll need to know the IP address range for the scope you want to create; which IP addresses, if any, you want to exclude from the address pool; which IP addresses, if any, you want to reserve; and the values for the DHCP options you want to set, if any.

Understand how relay agents help with multiple physical network segments. A question about relay agents on the exam may appear to be a DHCP- related question. Relay agents assist DHCP message propagation across network or router boundaries where such messages ordinarily wouldn’t pass.

Understand the difference between exclusions and reservations. When you want to exclude an entire range of IP addresses, you need to add that range as an exclusion. Any IP addresses within the range for which you want a permanent DHCP lease are known as reservations. Remember that exclusions are TCP/IP numbers in a pool that do not get issued and reservations are numbers in a TCP/IP pool that get issued only to the same client each time.

Understand DHCP failover. DHCP failover (and load sharing) is one of the hottest features in Windows Server 2022. It is easy to deploy, and it provides an added level of redundancy when compared to using a DHCP split- scope configuration.

Know how to configure DHCP name protection. DHCP name protection protects DNS Host A records from being overwritten by other client’s Host A records during DNS dynamic updates. DHCP name protection is configured using the DHCP Management Console.

Understand IP address management. IPAM allows you to track and audit IP addresses through the use of the IPAM console. IPAM allows IP addresses to be tracked using DHCP lease events and user logon events.Know how to provision IPAM and configure server discovery. IPAM is managed and monitored in Server Manager. Know that there are two separate provisioning models—m anual and GPO— and know how to configure each. Know how to configure IPAM server discovery.

Leave a Reply

Your email address will not be published. Required fields are marked *