Export-DhcpServer-File d: \dhcp\scripts\dhcpconfig.dmp
You can restore the configuration using Import-DhcpServer. The basic syntax is:
Import-DhcpServer -ComputerName ServerID -BackupPath CurrentConfigSavePath -File SavePath
Here, SavePath is the path and name of the file in which you stored the configuration settings and CurrentConfigSavePath specifies the path where the current configuration should be saved prior to importing and overwriting existing settings. In the following example, you back up the settings to d: \dhcp\backup\origconfig. dmp and then apply the saved configuration from d: \dhcp\scripts\dhcpconfig.dmp:
Import-DhcpServer-BackupPath d: \dhcp\backup\origconfig.dmp -File d: \dhcp\scripts\dhcpconfig.dmp
Managing DHCP scopes
After you install a DHCP server, you need to configure the scopes that the DHCP server will use. Scopes are pools of IP addresses you can lease to clients. As explained earlier in “Understanding scopes,” you can create superscopes, normal scopes, multicast scopes, and failover scopes with IPv4 addresses, but you can create only normal scopes with IPv6 addresses.
Creating and managing superscopes
A superscope is a container for IPv4 scopes in much the same way that an organizational unit is a container for Active Directory objects. Superscopes help you manage scopes available on the network by grouping them into a single point of management. For example, with a superscope, you can activate or deactivate multiple scopes through a single action. You can also view statistics for all scopes in the superscope rather than having to check statistics for each scope. Superscopes also support DHCP clients on a single physical network where multiple logical IP networks are used, or put another way, you can create superscopes to distribute IP addresses from different logical networks to the same physical network segment.
After you create at least one normal or multicast IPv4 scope, you can create a superscope by following these steps:
1. In the DHCP console, expand the node for the server with which you want to work, press and hold or right-click IPv4, and then tap or click New Superscope to start the New Superscope Wizard. Tap or click Next.
2. Enter a name for the superscope, and then tap or click Next.
3. Select scopes to add to the superscope. Select individual scopes by tapping or clicking their entry in the Available Scopes list. Select multiple scopes by tapping or clicking entries while holding down Shift or Ctrl.
4. Tap or click Next, and then tap or click Finish.
You can add scopes to a superscope when you create it, or you can add the scopes later. To add a scope to a superscope, follow these steps:
1. Press and hold or right-click the scope you want to add to a superscope, and then tap or click Add To Superscope.
2. In the Add Scope To A Superscope dialog box, select a superscope.
3. Tap or click OK. The scope is then added to the superscope.
To remove a scope from a superscope, follow these steps:
1. Press and hold or right-click the scope you want to remove from a superscope, and then tap or click Remove From Superscope.
2. Confirm the action by tapping or clicking Yes when prompted. If this is the last scope in the superscope, the superscope is deleted automatically.
When you activate or deactivate a superscope, you make all the scopes within the superscope active or inactive. To activate a superscope, press and hold or right-click the superscope, and then select Activate. To deactivate a superscope, press and hold or right-click the superscope, and then select Deactivate.
Deleting a superscope removes the superscope container but doesn’t delete the scopes it contains. If you want to delete the member scopes, you’ll need to do that separately. To delete a superscope, press and hold or right-click the superscope, and then select Delete. When prompted, tap or click Yes to confirm the action.
Creating and managing scopes
Scopes provide a pool of IP addresses for DHCP clients. A normal scope is a scope with class A, B, or C network addresses. A multicast scope is a scope with class D network addresses. Although you create normal scopes and multicast scopes differently, you manage them in much the same way. The key differences are that multicast scopes can’t use reservations, and you can’t set additional options for WINS, DNS, routing, and so forth.
You can create a normal scope for IPv4 addresses by following these steps:
1. In the DHCP console, expand the node for the server with which you want to work, and then press and hold or right-click IPv4. If you want to add the new scope to a superscope automatically, press and hold or right-click the superscope instead.
2. On the shortcut menu, tap or click New Scope to start the New Scope Wizard. Tap or click Next.
3. Enter a name and description for the scope, and then tap or click Next.
4. The Start IP Address and End IP Address boxes define the valid IP address range for the scope. On the IP Address Range page, enter a start address and an end address in these boxes.
NOTE Generally, the scope doesn’t include the x.x.x.0 and x.x.x.255 addresses, which are usually reserved for network addresses and broadcast messages, respectively. Accordingly, you would use a range such as 192.168.10.1 to 192.168.10.254 rather than 192.168.10.0 to 192.168.10.255.
5. When you enter an IP address range, the bit length and subnet mask are filled in for you automatically (as shown in Figure 8–6). Unless you use subnets, you should use the default values.
FIGURE 8–6 In the New Scope Wizard, enter the IP address range for the scope.
6. Tap or click Next. If the IP address range you entered is on multiple networks, you’re given the opportunity to create a superscope that contains separate scopes for each network and, in this case, select the Yes option button to continue, and then move on to step 8. If you make a mistake, tap or click Back, and then modify the IP address range you entered.
7. Use the Start IP Address and End IP Address boxes on the Add Exclusions And Delay page to define IP address ranges that are to be excluded from the scope. You can exclude multiple address ranges as follows:
■ To define an exclusion range, enter a start address and an end address in the Exclusion Range’s Start IP Address and End IP Address boxes, and then tap or click Add. To exclude a single IP address, use that address as both the start IP address and the end IP address.