Миграция dhcp сервера на windows server 2019

Migrating the DHCP service from the old server to the new Windows Server 2016/2019 with the saving of all the settings of the old server is quite easy. If the old DHCP server is running Windows Server 2008/R2 or Windows Server 2012/R2, you can directly transfer DHCP settings, zones, and reservations.

Migrating the DHCP service from the old server to the new Windows Server 2016/2019 with the saving of all the settings of the old server is quite easy. If the old DHCP server is running Windows Server 2008/R2 or Windows Server 2012/R2, you can directly transfer DHCP settings, zones, and reservations.

Deploying DHCP Server Role on Windows Server 2016/2019

First of all, you need to install the DHCP Server role on a new server which is running Windows Server 2016/2019. You can install the DHCP Server role using the Server Manager console, where you need to run the Add Roles Wizard in the Manage > Add Roles and Features menu and select the DHCP Server.

But it’s much easier to install the DHCP role and role management tools from RSAT (the DHCP MMC console and PowerShell module to interact with DHCP server) using PoSh. Run the PowerShell console as Administrator and run the following command:

Add-WindowsFeature -IncludeManagementTools DHCP

The -IncludeManagementTools parameter must be specified to install the DHCP server management console. By default, the Add-WindowsFeature cmdlet installs the DHCP server role without the appropriate console.

Next, you need to create local DHCP security groups (DHCP Administrators and DHCP Users):

Add-DhcpServerSecurityGroup

Note. These security groups are used to manage the local DHCP server:

  • DHCP Administrators — these are users with full permissions on the DHCP server (they can change any settings), but without local admin permissions on Windows Server;
  • DHCP Users — users with the rights to view DHCP server settings and statistics (including the DHCP Leases info).

To enable DHCP security settings associated with the local security groups created, restart the DHCP Server service:

Restart-Service DHCPServer

Authorize DHCP Server in Active Directory

The list of authorized DHCP servers in the AD domain can be displayed as follows:

Get-DhcpServerInDC

In order to authorize the new DHCP server in the Active Directory domain:

Add-DhcpServerInDC host1.contoso.com 192.168.10.35

migrate dhcp from 2008 to 2016

If you want to start a DHCP server without authorization in AD, you need to change the DisableRogueDetection registry parameter:

Set-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetServicesDHCPServerParameters" -Name DisableRogueDetection -Value 1 -Force

However, after the DHCP role is installed and the post-installation settings with PowerShell are performed, you can’t connect to the DHCP Server. You can see an alert message in the Server Manager console: a post-installation configuration is required, even though it has actually already been performed. In this case, even the server reboot won’t help to make this alert disappear.

migrate dhcp from 2012 to 2016

To remove this warning message and notify Server Manager that post-install DHCP configuration is complete, you need to modify the ConfigurationState registry parameter. Use the following PowerShell command to indicate that the actual DHCP server role has already been configured:

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINESOFTWAREMicrosoftServerManagerRoles12 –Name ConfigurationState –Value 2

After that, you need to restart the DHCP service:

Restart-Service -Name DHCPServer -Force

Moving DHCP Server from Windows Server 2008/R2/2012 to 2016/2019

In Windows Server 2012 special PowerShell cmdlets have been added, allowing you to import/export any DHCP server settings. Note that Microsoft simplified the procedure as much as possible, and we will need to execute only two PowerShell commands: Export-DhcpServer and Import-Dhcpserver, which can work remotely. All commands can be executed on one machine (the one to which the server migrates).

Create the folder C:DHCP (new-item C:DHCP -type directory) and run the command to export the configuration of the old DHCP server to the XML file named OldDHCPConf.xml.

Export-DhcpServer -ComputerName "oldDhcp.contoso.com" -Leases -File "C:DHCPOldDHCPConf.xml" –Verbose

migrate dhcp powershell

Now you can perform a full import of the DHCP configuration on the new server:

Import-DhcpServer -Leases –File "C:DHCPOldDHCPConf.xml" -BackupPath "C:DHCPBackup" –Verbose

Everything is ready. Run the DHCP console and check that all the DHCP scopes, reservations, and IP leases are in place.

migrate dhcp server 2012 to 2016

After the migration of the DHCP server completed, do not forget to reconfigure the DHCP Relay (IP Helper) agents on the routing network devices. Reconfigure them to the IP address of the new DHCP server.

DHCP Server Migration from Windows Server 2003 to 2016/2019

If you are using a legacy DHCP server on Windows Server 2003/R2, you need to use a different migration method. This is because Windows Server 2003 does not support the PowerShell cmdlets for exporting DHCP settings that are available in newer versions of Windows Server.

Log in to the Windows Server 2003 and open the command prompt. Run the following command in order to export DHCP server configuration to a binary file:

netsh dhcp server export C:psdhcp2003_config.dat all

Now copy the dhcp2003_config.dat file to the new DHCP Server running Windows Server 2016/2019 and import the configurations from a local file or over the network (using a UNC path):

netsh dhcp server import \winsrv2003dhcpc$psdhcp2003_config.dat all

Migrating DHCP Failover Configuration

If you are using a DHCP failover or load balancing DHCP configuration, after importing the DHCP settings on the first server, you only need to import only the server configuration on the second Windows Server:

Import-DhcpServer -Leases –File "C:DHCPOldDHCPConf.xml" -ServerConfigOnly  -BackupPath "C:DHCPBackup" –Verbose

After that, you need to perform the standard DHCP Failover configuration.

Remove the Old DHCP Server

Now you need to disable the DHCP service on the old server:

Stop-Service DHCPserver

Set-Service -Name DHCPServer -StartupType "Disabled"

And unauthorize the old DHCP server from Active Directory using the DHCP console (Right click on the DHCP server name > Unauthorize)

migrate dhcp server to windows server 2016

Or unauthorize your old DHCP Server in AD, using the following PowerShell command:

Remove-DhcpServerInDC -DnsName "oldDhcp.contoso.com” -IPAddress 192.168.10.36

Then uninstall the DHCP Server Role:

Uninstall-windowsfeature dhcp -remove 
Uninstall-WindowsFeature RSAT-DHCP

And reboot the server:

Restart-Computer -Force

  • #1

Всем добра!
Сразу скажу, я в этой теме новичок, поэтому тапками прошу не кидаться (я больше эникейщик).

Суть вопроса: есть сервер на базе windows server 2008 R2, требуется перенести настройки DHCP сервера (Экспортировать полную информацию о DHCP сервере, в том числе информацию о всех DHCP-областях и относящихся к ним резервированиях и арендованных IP-адресах) на windows server 2019.

1) Перед тем как заняться этим вопросом пришлось изучать powershell, вынести мозг сисадминам на работе, перечитать кучу инфы по настройке DHCP сервера, миграции настроек. Первоначально с помощью тех же сисадминов был написан скрипт если можно так назвать для переноса SCope:

Код:

$allScope = Get-DhcpServerv4Scope -ComputerName old_server_dc

foreach($oneScope in $allScope)

{

Add-DhcpServerv4Scope -StartRange $oneScope.StartRange -EndRange $oneScope.EndRange -Name $oneScope.Name -Description $oneScope.Description -State InActive -LeaseDuration $oneScope.LeaseDuration -Delay $oneScope.Delay -SubnetMask "255.255.255.0" -ComputerName new_server_dc

}

Проблема этого скрипта в том, что области переносились, а информация о резервированиях, арендованных IP-адресах и прочие настройки, ктр хранятся в ScopeOptions не перенеслись.

2) Начал ковырять гугл, нашел такие замечательные команды как:
Export-DhcpServer -ComputerName old_server_dc -File C:distrdhcpconfig.xml -verbose
и
Import-DhcpServer -ComputerName new_server_dc -File C:distrdhcpconfig.xml -BackupPath C:dhcpbackup -Leases
……….
и чуда не случилось, — точнее почти случилось. Были мигрированы Scopes, резервирования, Scope Options, а вот арендные IP-адреса не перенеслись.

Где допущены ошибки? Что я сделал не так?
Новый dhcp сервер еще не в работе, пока только стоит задача миграции настроек.

PS: для меня DHCP, это новая тема, новая возможность приблизиться к изучению сисадминистрирования, возможность изучить что-то новое (не всегда выпадает такой шанс).

PS: ниже прикрепил скрин ошибки которая возникает при импорте настроек.

error DHCP 20044.jpg

Последнее редактирование модератором: 09.09.2020

  • #2

не проще ли через оснастку — через backup / restore?

  • #3

Failed to add option definition 1 on DHCP server xxx: the class name being used is unknown or incorrect (20044)

docs.microsoft.com

  • #4

На старом сервере 1 DHCP сервер. На новом настроены DHCP 1 и 2. Failover (Hot standby). При всем желании не понимаю о каком параметре идет речь.

UEF


  • #5

На старом сервере 1 DHCP сервер. На новом настроены DHCP 1 и 2. Failover (Hot standby). При всем желании не понимаю о каком параметре идет речь.

The following errors are specific to configuring DHCP and DHCP High Availability.

Configure failover Failed — Error 20010
Problem:
Configure failover Failed. Error: 20010. The specified option does not exist.

Resolution:
A pre-defined scope option needs to be set up on the new DHCP server prior to setting up DHCP HA.

Check your existing configuration in DHCP server’s configuration and mirror any pre-defined scope options.

Configure failover Failed. Error: 20044.
Problem:
Configure failover Failed. Error: 20044. The specified DHCP class name is unknown or invalid.

Resolution:
A vendor class is missing and needs to be set up on the new DHCP server prior to setting up DHCP HA.

Check your existing configuration in DHCP server’s configuration and mirror any vendor class options. (this caught me due to an access point we had at a location that needed DHCP from the DHCP server.

Configure failover Failed. Error: 200103.
Problem:
Configure failover Failed. Error: 200103. Conflict in types for the same option on a host and added DHCP servers.

Resolution:
Validate there are pre-defined scope options that are conflicting. Check specifically for things like a checkbox for the array is checked or not checked, any vendors and/or value types are mirrored.

We hope this helps anyone who runs into these common problems setting up DHCP HA in Windows 2012 R2.

Supporting Links

  • #6

Класс поставщика отсутствует, и его необходимо настроить на новом DHCP-сервере до настройки DHCP HA.
Такой смысл:unsure:

1599649495976.png

  • #7

Класс поставщика отсутствует, и его необходимо настроить на новом DHCP-сервере до настройки DHCP HA.
Такой смысл:unsure:

Посмотреть вложение 10769

Я смотрел в этом пункте меню. Сравнивал с теми настройками которые есть на старом DHCP сервере. Везде по умолчанию 3 класса. На что конкретно надо обратить внимание?

Screenshot_1.jpg

Мне необходимо добавить еще какой-то класс?

Последнее редактирование модератором: 09.09.2020

  • #8

Класс поставщика отсутствует, и его необходимо настроить на новом DHCP-сервере до настройки DHCP HA.
Такой смысл:unsure:

Посмотреть вложение 10769

Подскажи пож, что по классам должно быть добавлено?

  • #9

как я понял смысл в том что нужно сначала выполнить экспорт — импорт а только потом поднимать DHCP HA

  • Remove From My Forums
  • Question

  • I’m in the process of slowly decommissioning our 2008R2 servers, and DHCP is next on the list for this particular server.  I’m curious if anyone used the backup / restore tools to migrate to 2019? 

    I know Microsoft has a post from 2016 for server 2008 and 2012, and they suggest using a migration tool with power shell commands.

    I’ve also seen some simple suggestions to:

    1. Install DHCP server role on the new server but
      make sure it is not started.
    2. Export-DHCPServer –Computername (SourceComputerName) c:dhcp.xml -ver
    3. Stop DHCP server on the source server and start it on the target server
    4. Import-DHCPServer –Computername (DestinationServer) c:dhcp.xml –BackupPath c:dhcpbackup and type Y to accept
    5. Check scope and change server option so that DNS is set correct etc

    So I’m just curious who all has recently done this, and what processes worked?

Answers

  • Hi,
    >>So I’m just curious who all has recently done this, and what processes worked?
    I have tested the following steps in my lab and get a successful result.
    1.Install DHCP server role on the new server but make sure it is not started.
    2.Export-DHCPServer –Computername (SourceComputerName) c:dhcp.xml -ver
    3.Stop DHCP server on the source server and start it on the target server
    4.Import-DHCPServer –Computername (DestinationServer) c:dhcp.xml –BackupPath c:dhcpbackup and type Y to accept.

    Please check the following pictures:

    For more details, you can refer this article:

    How to: Migrate DHCP
    from Windows Server 2008 to Windows Server 2019

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Hope this can help you, if you have anything unclear, please let me know.
    Best Regards,
    Ellen


    Please remember to mark the replies as answers if they help and
    unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact
    tnmff@microsoft.com.

    • Edited by

      Thursday, October 24, 2019 8:51 AM

    • Marked as answer by
      JoeFri
      Monday, October 28, 2019 12:20 PM








  1. Learn
  2. Windows
  3. Windows Server
Author Ed (Microsoft UK)
Feb 19, 2019
1 Minute Read


  • Share
    Opens a new window

    • Facebook
      Opens a new window

    • Twitter
      Opens a new window

    • Reddit
      Opens a new window

    • LinkedIn
      Opens a new window

Register. Track Progress. Earn Credits.
Learning has never been so easy!

Sign Up

Данная статья описывает процедуру установки и настройки DHCP сервера на базе Windows Server 2019. В статье описаны особенности установки и настройки DHCP роли, создания областей DHCP, настройки их параметров и резервации статических адресов. Мы рассмотрим как привычный способ настройки параметров DHCP сервера через графическую консоль, так и настройку DHCP из командной строки PowerShell.

Протокол DHCP (Dynamic Host Configuration Protocol) используется для автоматического назначения сетевых настроек (IP адрес, маска подсети, шлюз, DNS сервера и т.д.) устройствам в вашей сети (компьютеры, ноутбуки, сканеры, принтеры и т.д.). Также DHCP сервер позволяет более эффективно использовать адресное пространство, избегать конфликта IP адресов в сети и централизованно управлять сетевыми параметрами на клиентских устройствах.

Содержание:

  • Установка роли DHCP сервера в Windows Server 2019/2016
  • Настройка DHCP областей в Windows Server
  • Резервация IP адресов на DHCP сервере
  • Настройка и управление DHCP сервером с помощью PowerShell

Установка роли DHCP сервера в Windows Server 2019/2016

В этом примере мы установим DHCP сервер на хосте с Windows Server 2019 и IP адресом 192.168.13.4. Вы можете использовать как Server Core версию, так и Full GUI. В маленькой инфраструктуре допустимо устанавливать DHCP сервер на сервер с ролью контроллера домена Active Directory.

Обязательно назначьте статический IP адрес серверу с ролью DHCP сервер. При установке роли DHCP из консоли PowerShell на сервере с автоматическим получением IP адреса появляется предупреждение:

Configure at least one static IP address on your computer before installing DHCP.
WARNING: The following recommended condition is not met for DHCP: No static IP addresses were found on this computer. If the IP address changes, clients might not be able to contact this server. Please configure a static IP address before installing DHCP Server.

Установить роль DHCP Server можно из консоли Server Manager (Add Roles and Features -> Server Roles).

установка роли DHCP server в windows server 2019

После установки роли DHCP роли нужно выполнить Post-Deployment Configuration. Для этого в консоли Server Manager щелкните по уведомлению и выберите Complete DHCP configuration.

выберите Complete DHCP configuration

Вам будет предложено аутентифицировать новый DHCP сервер в Active Directory (экран Authorization). Для авторизации DHCP сервера в AD учетная запись должна состоять в доменной группе Enterprise Admins.

Если у вас нет прав на авторизацию DHCP в AD, вы можете указать, чтобы ваш DHCP сервер запускался без проверки авторизации в домене:

Set-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetServicesDHCPServerParameters" -Name DisableRogueDetection -Value 1 -Force

авторизовать сервер DHCP в Active Directory

Также вы можете установить и настроить DHCP роль в Windows Server из консоли PowerShell.

Установка роли DHCP:

Install-WindowsFeature DHCP –IncludeManagementTools

Проверьте, что роль и инструменты управления RSAT-DHCP установлены:

Get-WindowsFeature -Name *DHCP*| Where Installed

установка DHCP сервера с помощью powershell

Авторизуйте DHCP сервер в Active Directory (укажите DNS имя сервера и IP адрес, который будет использоваться DHCP клиентами):

Add-DhcpServerInDC -DnsName hq-dc01.contoso.com -IPAddress 192.168.13.4

Создайте локальные группы безопасности DHCP сервера:

Add-DhcpServerSecurityGroup

Чтобы Server Manager перестал показывать уведомление о том, что DHCP роль требует настройки, выполните команду:

Set-ItemProperty -Path HKLM:SOFTWAREMicrosoftServerManagerRoles12 -Name ConfigurationState -Value 2

Перезапустите службу DHCPServer:

Restart-Service -Name DHCPServer -Force

База данных и логи DHCP сервера находятся в каталоге
%systemroot%system32dhcp
.

  • dhcp.mdb — файл базы данных сервера DHCP’;
  • j50.log – транзакционный журнал (используется при восстановлении конфигурации DHCP);
  • j50.chk — файл контрольной точки;
  • tmp.edb — временный рабочий файл DHCP-сервера.

Настройка DHCP областей в Windows Server

После установки роли DHCP вам нужно создать DHCP области (Scopes), которые описывают диапазоны IP адресов и другие настройки, выдающиеся сервером клиентам.

Для управления сервером DHCP используется консоль dhcpmgmt.msc (вы можете управлять DHCP сервером локально или с удаленного компьютера с установленным RSAT). Запустите консоль DHCP, разверните ваш сервер -> IPv4.

Чтобы создать новую область выберите New Scope.

создать новую dhcp область

Укажите название DHCP области.

название DHCP области

Укажите диапазон IP адресов, который будет выдаваться этой областью и маску сети. В этом примере я хочу использовать эту DHCP область для обслуживания подсети 192.168.100.0/24. В рамках этой сети DHCP сервером будет назначаться динамические IP адреса из диапазона 192.168.100.50 — 192.168.100.250. В следующем окне можно добавить исключения в этот диапазон (Add Exclusions and Delay).

диапазон IP адресов области DHCP

Далее нужно указать длительность аренды (Lease Duration) IP адреса DHCP клиентом (по умолчанию 8 дней, менять без особой необходимости не нужно).

срока аренды адреса на dhcp

Укажите, что вы хотите настроить дополнительный параметры DHCP области.

настроить опции dhcp области .

Укажите IP адрес шлюза в подсети, который должен назначаться клиентам (в нашем примере это 192.168.100.1).

задать адрес шлюза по-умолчанию для dhcp области

Затем укажите имя домена и адреса DNS серверов, которые будут назначены клиентам DHCP.

настройки DNS для DHCP области

Осталось активировать DHCP область (разрешить ей обслуживать клиентов).

активировать DHCP зону

DHCP сервер может выдавать клиентам различный настройки (кроме IP адреса). Для этого используются Scope Options.

В Windows Server DHCP можно настроить глобальные настройки области или Scope Options для каждой области.

опции DHCP scope

Ранее мы уже настроили три опции области:

  • 003 Router
  • 006 DNS Server
  • 015 DNS Domain Name

Можно добавить и другие опции (NTP сервера, PXE и т.д.).

В разделе Server Options DHCP сервера можно настроить глобальные опции, которые будут наследуются всеми областями. Но вы можете переопределить глобальные настройки в настройках каждой области (опции области имеют приоритет над опциями сервера).

настроить параметры DHCP сервера

Один DHCP сервер может обслуживать сотни удаленных подсетей и VLAN. Поэтому вы можете создать на нем несколько областей. Главное, чтобы в каждой из подсетей был настроен ретранслятор (DHCP relay agent), который пересылает широковещательные DHCP-запросы на указанный DHCP сервер. В терминах Cisco DHCP ретранслятор называется ip helper. Вы можете настроить DHCP Relay даже на Windows Server.

Протокол DHCP в качестве транспорта использует протокол UDP. Пакеты от клиента к серверу передаются по порту 67 UDP, обратно через UDP 68

Резервация IP адресов на DHCP сервере

По умолчанию DCHP сервер выдает клиентам динамические адреса. Это означает что IP адрес у любого клиента может меняться. Если вы хотите, чтобы определенные устройства всегда получали от DHCP сервера один и тот же адрес, вы можете его зарезервировать (например, для сетевых принтеров, которые настроены у пользователей).

Для DHCP резервации выберите область и перейдите в секции Reservation. В меню выберите New Reservation.

Резервация IP адреса на DHCP

При создании резервации нужно указать IP адрес, который нужно сохранить за клиентом и его MAC адрес (уникальное значение). MAC адрес в Windows можно получить из результатов команды
ipconfig /all
или с помощью PowerShell
get-netadapter|select name,macaddress
). Опционально можно указать имя и описание устройства.

Укажите MAC адрес устройства для резервации IP адреса на DHCP

Также вы можете зарезервировать текущий динамический адрес за устройством, найдя его в разделе Address Leases. Щелкните по устройству и выберите Add to Reservation.

Add to Reservation

Настройка и управление DHCP сервером с помощью PowerShell

Все операции по настройке и управлению DHCP сервером на Windows Server 2019/2016 можно выполнять из консоли PowerShell. Рассмотрим основные команды управления DHCP. Для этого используется модуль DHCPServer. Импортируйте модуль в сессию:

Import-Module DHCPServer

Вывести полный список командлетов в моделе DHCP можно так:

Get-Command -Module DHCPServer

PowerShell модуль DHCPServer

Следующая команда выведет список авторизованных DHCP серверов в Active Directory:

Get-DhcpServerInDC

Вывысти список DHCP серееров в домене

Вывести список DHCP областей на указанном сервере:

Get-DhcpServerv4Scope –ComputerName msk-dhcp1

Если нужно показать все параметры области (Delay, Description, Name и т.д.):

Get-DhcpServerv4Scope –ComputerName msk-dhcp1| FL *

Список областей на DHCP сервере

Если нужно отобразить данные о IPv6 областях:

Get-DHCPServerv6Scope

Получить настройки для конкретной области:

Get-DhcpServerv4Scope –ComputerName msk-dhcp1 –ScopeID 10.10.1.0

Создадим новую (неактивную) область с диапазоном адресов с 192.168.113.50 до 192.168.113.250:

Add-DhcpServerv4Scope -Name “Brahch1 192.168.113.0” -StartRange 192.168.113.50 -EndRange 192.168.113.250 -SubnetMask 255.255.255.0 -State InActive

Настроить следующие параметры DHCP сервера: DNS сервер, домен и адрес шлюза по-умолчанию:

Set-DhcpServerv4OptionValue -ScopeID 192.168.113.0 -DnsDomain contoso.com -DnsServer 192.168.13.4 -Router 192.168.113.1

Добавить исключения в DHCP область:

Add-DhcpServerv4ExclusionRange -ScopeID 192.168.113.0 -StartRange 192.168.113.90 -EndRange 192.168.113.100

Активировать DHCP область:

Set-DhcpServerv4Scope -ScopeID 192.168.113.0 -State Active

Add-DhcpServerv4Scope - создать и настроить области на DHCP сервере командами PowerShell

Для удобства можно использовать такую команду PowerShell при создании новой области:

$HashArgs = @{
'Name' = 'EKB Office Scope';
'Description' = 'workstations';
'StartRange' = '192.168.140.10';
'EndRange' = '192.168.140.200';
'SubnetMask' = '255.255.255.0';
'State' = 'Active';
'LeaseDuration' = '1.00:00:00';
}
Add-DhcpServerv4Scope @HashArgs

Опции для DHCP сервера добавляется так (к примеру, WPAD):

Add-DhcpServerv4OptionDefinition -ComputerName msk-dhcp1 -Name WPAD -OptionId 252 -Type String

Вывести список настроенных опций DHCP сервера можно так:

Get-DHCPServerv4OptionValue -ComputerName msk-dhcp1 | Format-List

Выведем список настроенных параметров зоны:

Get-DHCPServerv4OptionValue -ComputerName msk-dhcp1 -ScopeId 10.10.1.0 | Format-List

Показать текущий список арендованных адресов для области 10.10.1.0:

Get-DHCPServerv4Lease -ScopeId 10.10.1.0 -ComputerName msk-dhcp1

Список аренд на DHCP сервере

Создать DHCP резервацию для клиента, которому назначен динамический IP адрес 10.10.1.88 (конвертировать выданный адрес в зарезервированный):

Get-DhcpServerv4Lease -ComputerName msk-dhcp1 -IPAddress 10.10.1.88| Add-DhcpServerv4Reservation -ComputerName msk-dhcp1

Можно массово зарезервировать IP адреса для компьютеров по списку из csv файла. Для этого создайте текстовый файл в формате:

ScopeId,IPAddress,Name,ClientId,Description
10.10.1.0,10.10.1.88,Client1,ba-ab-5c-3d-4e-6f,Reservation PC-msk-s1
10.10.1.0,10.10.1.89,Client2,ba-ab-5c-5d-2e-3f,Reservation PC-msk-s2

Сохраните файл с именем
c:dhcpDHCPReservations.csv
и запустите следующую команду, которая импортирует данные из csv файла и создаст DHCP резервации для клиентов:

Import-Csv –Path c:dhcpDHCPReservations.csv | Add-DhcpServerv4Reservation -ComputerName msk-dhcp1

Отключить область на DHCP сервере:

Set-DhcpServerv4Scope -ComputerName msk-dhcp1-ScopeId 10.10.1.0-State InActive

Удалить область с DHCP сервера:

Remove-DHCPServerv4Scope -ComputerName msk-dhcp1-ScopeId 10.10.1.0 -Force

Возможно получить статистику DHCP сервера (количество областей, резерваций, процент использования адресов и пр.).

Get-DhcpServerv4Statistics -ComputerName msk-dhcp1

Статистика использования DHCP сервера

Аналогичная информация для конкретной области может быть получена с помощью командлета Get-DhcpServerv4ScopeStatistics.

Конфигурацию DHCP сервера можно экспортировать в указанный XML файл с помощью команды:

Export-DHCPServer -ComputerName msk-dhcp1 -File C:dhcpdhcp-export.xml

Совет. Заданием с такой командой в планировщике задач можно реализовать регулярное резервное копирование конфигурации DHCP сервера.

В дальнейшем эти настройки DHCP сервера можно импортировать (перенести) на другой DHCP сервер:

Import-DHCPServer -ComputerName msk-dhcp2 -File C:dhcpdhcp-export.xml -BackupPath C:dhcpbackup

  • Remove From My Forums
  • Question

  • Hi Team,

    Our DHCP server is running in 2003 Standard R2  SP3, now we want to migrate the DHCP server from 2003 to  2019.Is there any way I can migrate the server directly from 2003 2019

    Thanks

    Rajith

Answers

  • Hi Rajith,

    If you want to upgrade 2003 to 2019 directly on a computer, it is definitely not supported.

    But if you have another computer running Server 2019
    (installed DHCP role) and you want to migrate the DHCP database to it, it is theoretically possible.

    You can test this with the netsh dhcp server export / import command.

    Hope this can help you, if you have anything unclear, please let me know.

    Have a nice day!

    Allan


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact
    tnmff@microsoft.com.

    • Proposed as answer by

      Wednesday, January 15, 2020 8:12 AM

    • Marked as answer by
      Rajith M
      Sunday, January 19, 2020 5:16 PM

  • Remove From My Forums
  • Question

  • Hi Team,

    Our DHCP server is running in 2003 Standard R2  SP3, now we want to migrate the DHCP server from 2003 to  2019.Is there any way I can migrate the server directly from 2003 2019

    Thanks

    Rajith

Answers

  • Hi Rajith,

    If you want to upgrade 2003 to 2019 directly on a computer, it is definitely not supported.

    But if you have another computer running Server 2019
    (installed DHCP role) and you want to migrate the DHCP database to it, it is theoretically possible.

    You can test this with the netsh dhcp server export / import command.

    Hope this can help you, if you have anything unclear, please let me know.

    Have a nice day!

    Allan


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact
    tnmff@microsoft.com.

    • Proposed as answer by

      Wednesday, January 15, 2020 8:12 AM

    • Marked as answer by
      Rajith M
      Sunday, January 19, 2020 5:16 PM

Понравилась статья? Поделить с друзьями:
  • Мерцает панель задач в windows 10 после обновления
  • Мессенджер для локальной сети windows 10
  • Миграция dhcp сервера на windows server 2016
  • Мессенджер для вконтакте для windows 7
  • Миграция dhcp сервера на windows server 2012