-->
Modifies one or more configuration parameters of the database of the DHCP server service.
Dhcp.mdb: The primary database file for the DHCP server; J50.log: A transaction log file used to recover incomplete transactions in case of a server malfunction; J50.chk: A checkpoint file used in truncating the transaction log for the DHCP server; Res1.log: A reserved log file for the DHCP server.
Syntax
Description
The Set-DhcpServerDatabase cmdlet modifies one or more configuration parameters of the database of the Dynamic Host Configuration Protocol (DHCP) server service.
Examples
Example 1: Modify values for the DHCP server service
This example sets the file name to D:NewDhcpPathdhcp.mdb and the backup path to D:NewDhcpPathbackup.This cmdlet also sets the periodicity of the database backup to 30 minutes and the periodic cleanup of the database to 120 minutes.
Parameters
Runs the cmdlet as a background job.Use this parameter to run commands that take a long time to complete.The cmdlet immediately returns an object that represents the job and then displays the command prompt.You can continue to work in the session while the job completes.To manage the job, use the
*-Job
cmdlets.To get the job results, use the Receive-Job cmdlet.For more information about Windows PowerShell速 background jobs, see about_Jobs.Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the interval of time between automatic database backups, in minutes.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the path of the directory where the database is backed up.
Type: | String |
Position: | 2 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Runs the cmdlet in a remote session or on a remote computer.Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet.The default is the current session on the local computer.
Type: | CimSession[] |
Aliases: | Session |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the interval of time for database cleanup, in minutes.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the DNS name, or IPv4 or IPv6 address, of the target computer that runs the DHCP server service.
Type: | String |
Aliases: | Cn |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the database backup file.
Type: | String |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Returns an object representing the item with which you are working.By default, this cmdlet does not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that database has to be restored from backup.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.If this parameter is omitted or a value of
0
is entered, then Windows PowerShell速 calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.The throttle limit applies only to the current cmdlet, not to the session or to the computer.Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs.The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.Management.Infrastructure.CimInstance#root/Microsoft/Windows/DHCP/DhcpServerDatabase
Outputs
Microsoft.Management.Infrastructure.CimInstance#root/Microsoft/Windows/DHCP/DhcpServerDatabase
The
Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects.The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object.Related Links
This article describes how to move a Dynamic Host Configuration Protocol (DHCP) database from a computer that is running Microsoft Windows Server 2003 to Microsoft Windows Server 2008. You may be unable to see the Leases in the Address Leases option on the DHCP Server and the content in Reservations may be unavailable after you restore the DHCP. To restore a backup copy of the DHCP database: Click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as Administrator. Type net stop dhcpserver, and then press ENTER.
Techniques and tools for repairing this crucial network serviceUsers logging on, file servers serving, applications running—music to the ears of administrators and network users. Isn't life great when the network is running smoothly?
Life is so great that you can easily forget how quickly your utopian computing world can come crashing down when a crucial network service fails. In a matter of minutes, your smoothly functioning masterpiece of connectivity can dissolve into a living nightmare.DHCP is one of a set of services (others include Active Directory—AD—and WINS) that every Windows 2000, Windows NT, and mixed-environment network uses to provide essential functions to network users and applications. Knowing DHCP's vulnerabilities and being familiar with recovery techniques and tools will help you quickly recover when DHCP isn't functioning properly. In many cases, successful recovery also depends on you taking some necessary preparatory steps. To be sure that you're prepared to administer CPR should DHCP ever need it, let's review DHCP recovery.DHCP: A Blessing and a CurseIn NT 3.5, Microsoft introduced an implementation of a new IP addressassignment protocol called DHCP.
(Internet Engineering Task Force—IETF—Request for Comments—RFC—1531 defines DHCP.) Since then, DHCP has won the hearts and minds of many Win2K and NT network administrators. DHCP eliminates the administrative burden of manually configuring TCP/IP on network workstations. In addition, DHCP lets you automatically assign IP addresses to clients and configure additional properties of clients' IP stacks, such as the default gateway, DNS and WINS servers, and the WINS node type.Although DHCP has been an administrative boon, it also presents challenges. One of the biggest problems with DHCP is that it doesn't provide solid fault-tolerance features.
Microsoft designed its DHCP services so that one server on each subnet provides DHCP services to the clients on that subnet. Network administrators must configure network routers to pass BOOTP or DHCP requests from clients on one subnet to a DHCP server on a different subnet. (The IETF defines BOOTP forwarding in RFC 1542.) In this scenario, a DHCP server can respond to a remote client's DHCP request only if you've configured the server to serve addresses that are appropriate for the remote client's subnet.This setup isn't convenient or realistic for many organizations because it requires each server to hold nonoverlapping IP address scopes for multiple subnets.
These addresses are effectively unusable because the server is holding them for remote clients' use. In privately addressed networks (e.g., those using the subnet mask 10.x.x.x, 192.168.x.x, or 172.16.x.x), this situation doesn't pose much of a problem because IP addresses are free and plentiful. However, this solution isn't ideal for you if you're using routable IP addresses that your ISP has assigned and you don't have many to spread among multiple DHCP servers or if you have a complex network that contains many IP subnets.During the development of Win2K, Microsoft promised to provide new fault-tolerance features in Win2K's DHCP services. However, the company actually delivered these features only for DHCP servers running in a clustered configuration, which requires the significantly more expensive Win2K Advanced Server or Win2K Datacenter Server and cluster-compatible hardware. As a result, in Windows networks that don't run Win2K AS or Win2K Datacenter, each network subnet tends to depend strongly on one DHCP server.Reviving DHCP ServicesUnless your DHCP servers run in a clustered Win2K configuration, a failure of the DHCP service or the server hosting it will cause you some major headaches.
Mdb File Viewer
(For information about how to add DHCP to a clustered server configuration, see 'Related Articles.' ) If DHCP fails, clients that have existing DHCP leases will continue to function properly, but new clients that want to request an IP address or those that attempt to renew their DHCP lease with the server will be unable to do so. When your DHCP service is unavailable, you can use one of two revival remedies: restore the functionality of the existing service or move the DHCP service to another server.Repairing DHCP services on the original server is the desirable option if the server is operable but the DHCP service is malfunctioning as a result of a corrupt DHCP database. The DHCP database, dhcp.mdb, is a Jet database that contains DHCP server configuration data about address scopes and active client leases.
Restore Dhcp From Mdb File Converter
On Win2K and NT DHCP servers, most of the configuration data in this database is mirrored in the system registry in the HKEYLOCALMACHINESYSTEMCurrentControlSetServicesDHCPServerConfiguration registry subkey.Like any database, DHCP's configuration database can become damaged or acquire invalid data. A telltale sign of DHCP database corruption is the appearance of event ID 1014 error messages in a DHCP server's System event log. These messages' Source is DhcpServer, and their Description includes a reference to Jet database error code 510, 1022, or 1850. (For a list of Jet database error codes and their descriptions, see 'Related Articles.'
) If your DHCP database is corrupt, you can restore a known good copy of the database or regenerate the database from the DHCP server registry subkey.Restoring the database from a known good copy is the easier option if a recent backup is available. By default, Win2K and NT 4.0's DHCP services automatically create a backup copy of the DHCP database once per hour in the server's%systemroot%system32dhcpbackupjetnew folder. (To modify the frequency of these backups, change the value of the BackupInterval parameter in the HKEYLOCALMACHINESYSTEMCurrentControlSetServicesDHCPServerParameters subkey from the default setting of 60 minutes.)After you locate the backup copy of your DHCP database, take the following steps to restore the corrupt database:. Use Win2K's Administrative Tools Services Console or NT 4.0's Control Panel Services applet to stop the DHCP service. Alternatively, you can issue the commandnet stop dhcpserverat a command prompt. To preserve the contents of the DHCP database folder, create a backup copy of the folder (%systemroot%system32dhcp) in another location. Either use the DHCP Export Import (DhcpExim) utility to import the backup DHCP database, or copy the backup copy of the dhcp.mdb database file that's in the%systemroot%system32dhcpbackupjetnew folder to the primary DHCP database folder (%systemroot%system32dhcp).
You can also restore a backup copy of the database from an alternative source (e.g., a tape drive or other backup device, a replication partner server). However, use the direct file-copy method only if the two servers involved are running the same OS. For more information about the DhcpExim utility, see the sidebar 'DhcpExim in Action.' . The DHCP service is still stopped, so take this opportunity to use the Jetpack utility to compact and verify the restored copy of the database. Go to a command prompt window, change to the%systemroot%system32dhcp folder, and typejetpack dhcp.mdb tmp.mdbFor more information about Jetpack, see the sidebar 'Using Jetpack for Proactive Compacting,' page 66.
Restart the DHCP service.The Microsoft article 'How to Move a DHCP Database to Another Windows NT Server' (recommends using the file-copy method rather than the DhcpExim utility when moving a database from an NT 4.0 system to a Win2K system. Don't follow this recommendation. For seamless cross-platform DHCP management and data migration, use the DhcpExim utility.Regeneration RecoveryWhat can you do if you don't have a good backup of the DHCP configuration database?