Windows domain enumeration что это

Enumerating Domain Controllers

In earlier versions of Windows, an application could only obtain a single domain controller in a domain by calling DsGetDcName. There was no way to predict which domain controller would be retrieved or to obtain a list of the domain controllers. Windows enables an application to enumerate the domain controllers in a domain by using the DsGetDcOpen, DsGetDcNext, and DsGetDcClose functions.

To enumerate a domain controller, call DsGetDcOpen. This function takes parameters that define the domain to enumerate and other enumeration options. DsGetDcOpen provides a domain enumeration context handle that is used to identify the enumeration operation when DsGetDcNext and DsGetDcClose are called.

The DsGetDcNext function is called with the domain enumeration context handle to retrieve the next domain controller in the enumeration. The first time this function is called, the first domain controller in the enumeration is retrieved. The second time this function is called, the second domain controller in the enumeration is retrieved. This process is repeated until DsGetDcNext returns ERROR_NO_MORE_ITEMS, that indicates the end of the enumeration.

The DsGetDcNext function will enumerate the domain controllers in two groups. The first group contains the domain controllers that cover the site of the computer where the function is executed and the second group contains the domain controllers that do not cover the site of the computer where the function is executed. If the DS_NOTIFY_AFTER_SITE_RECORDS flag is specified in the OptionFlags parameter in DsGetDcOpen, the DsGetDcNext function will return ERROR_FILEMARK_DETECTED after all of the site-specific domain controllers have been retrieved. DsGetDcNext will then begin enumerating the second group, which contains all domain controllers in the domain, including the site-specific domain controllers contained in the first group.

Domain controllers that handle the site of the computer where the function is executed are enumerated first followed by the domain controllers that do not cover the site of the computer where the function is executed. A domain controller is said to cover a site if the domain controller is configured to reside in that site or if the domain controller resides in a site that is nearest to the site in question in terms of the configured inter-site link cost. If there are any domain controllers in both the group of domain controllers that cover and the group of domain controllers that do not cover the computer site, domain controllers are returned within the group in order of their configured priorities and weights that are specified in DNS. Domain controllers that have lower numeric priority are returned within a group first. If within a site-related group there is a subgroup of several domain controllers with the same priority, domain controllers are returned in a weighted random order where domain controllers with higher weight have more probability to be returned first. The sites, priorities, and weights are configured by the domain administrator to achieve effective performance and load balancing among multiple domain controllers available in the domain. Because of this, applications that use the DsGetDcOpen/DsGetDcNext/DsGetDcClose functions automatically take advantage of these optimizations.

When the enumeration is complete or is no longer required, the enumeration must be closed by calling DsGetDcClose with the domain enumeration context handle.

Читайте также:  Установка windows 2003 для терминального сервера

To reset the enumeration, it is necessary to close the current enumeration by calling DsGetDcClose and then reopen the enumeration by calling DsGetDcOpen again.

Example

The following code example shows how to use these functions to enumerate the domain controllers in the local domain.

Перенос доменного пространства имен в режим Windows Server 2008 Migrate a domain-based namespace to Windows Server 2008 Mode

Область применения: Windows Server 2019, Windows Server (половина ежегодного канала), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008 Applies to: Windows Server 2019, Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008

Режим Windows Server 2008 для доменных пространств имен предусматривает поддержку перечисления на основе доступа и повышенную масштабируемость. The Windows Server 2008 mode for domain-based namespaces includes support for access-based enumeration and increased scalability.

Перенос доменного пространства имен в режим Windows Server 2008 To migrate a domain-based namespace to Windows Server 2008 mode

Для переноса доменного пространства имен из режима Windows 2000 Server в режим Windows Server 2008 необходимо экспортировать пространство имен в файл, удалить пространство имен, заново создать его в режиме Windows Server 2008, а затем импортировать параметры пространства имен. To migrate a domain-based namespace from Windows 2000 Server mode to Windows Server 2008 mode, you must export the namespace to a file, delete the namespace, re-create it in Windows Server 2008 mode, and then import the namespace settings. Чтобы это сделать, выполните следующие действия: To do so, use the following procedure:

Откройте окно командной строки и введите следующую команду, чтобы экспортировать пространство имен в файл, где \ \ доменное \ пространство имен — это имя соответствующего домена, а пространство имен и *путь к \ * файлу — это путь и имя файла для экспорта: Open a Command Prompt window and type the following command to export the namespace to a file, where \\domain\namespace is the name of the appropriate domain, and namespace and path\filename is the path and file name of the file for export:

Запишите путь ( \ \ server \ Общая папка сервера) для каждого сервера пространства имен. Write down the path ( \\server \share ) for each namespace server. Необходимо вручную добавить серверы пространства имен во вновь созданное пространство имен, поскольку команда Dfsutil не может импортировать серверы пространства имен. You must manually add namespace servers to the re-created namespace because Dfsutil cannot import namespace servers.

В оснастке «Управление DFS» щелкните правой кнопкой мыши пространство имен и выберите Удалить, или введите в командной строке следующую команду, In DFS Management, right-click the namespace and then click Delete, or type the following command at a command prompt,
где \ \ доменное \ пространство имен — это имя соответствующего домена и пространства имен: where \\domain\namespace is the name of the appropriate domain and namespace:

В оснастке «Управление DFS» заново создайте пространство имен с тем же именем, но с использованием режима Windows Server 2008, или введите в командной строке следующую команду, где In DFS Management, re-create the namespace with the same name, but use the Windows Server 2008 mode, or type the following command at a command prompt, where
\\Серверная \ пространство имен — это имя соответствующего сервера и общего ресурса для корня пространства имен: \\server\namespace is the name of the appropriate server and share for the namespace root:

Чтобы импортировать пространство имен из файла экспорта, введите в командной строке следующую команду, где To import the namespace from the export file, type the following command at a command prompt, where
\\домен \ пространство имен — это имя соответствующего домена и пространства имен, а имя файла *пути \ * — это путь к импортируемому файлу в файле: \\domain\namespace is the name of the appropriate domain and namespace and path\filename is the path and file name of the file to import:

Читайте также:  Нарисовать линию windows form

Чтобы свести к минимуму время, необходимое для импорта большого пространства имен, выполняете команду импорта корня Dfsutil локально на сервере пространства имен. To minimize the time required to import a large namespace, run the Dfsutil root import command locally on a namespace server.

Добавьте все остальные серверы пространства имен во вновь созданное пространство имен, щелкнув правой кнопкой мыши пространство имен в оснастке «Управление DFS» и выбрав команду Добавить сервер пространства имен, или, введя в командной строке следующую команду, где Add any remaining namespace servers to the re-created namespace by right-clicking the namespace in DFS Management and then clicking Add Namespace Server, or by typing the following command at a command prompt, where
\\Серверная \ Share — это имя соответствующего сервера и общего ресурса для корня пространства имен: \\server\share is the name of the appropriate server and share for the namespace root:

Можно добавить серверы пространства имен перед импортом пространства имен, однако в этом случае серверы пространства имен будут загружать метаданные для пространства имен инкрементным образом, а не загружать все пространство имен сразу же после добавления в качестве сервера пространства имен. You can add namespace servers before importing the namespace, but doing so causes the namespace servers to incrementally download the metadata for the namespace instead of immediately downloading the entire namespace after being added as a namespace server.

Выбор типа пространства имен Choose a namespace type

Область применения: Windows Server 2019, Windows Server (половина ежегодного канала), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008 Applies to: Windows Server 2019, Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008

При создании пространства имен необходимо выбрать один из двух типов пространства имен: изолированное пространство имен или доменное пространство имен. When creating a namespace, you must choose one of two namespace types: a stand-alone namespace or a domain-based namespace. Кроме того, если вы выбрали доменное пространство имен, необходимо выбрать режим пространства имен: режим Windows 2000 Server или режим Windows Server 2008. In addition, if you choose a domain-based namespace, you must choose a namespace mode: Windows 2000 Server mode or Windows Server 2008 mode.

Выбор типа пространства имен Choosing a namespace type

Выбирайте изолированное пространство имен, если в вашей среде выполняется какое-либо из следующих условий: Choose a stand-alone namespace if any of the following conditions apply to your environment:

  • В вашей организации не используются доменные службы Active Directory (AD DS). Your organization does not use Active Directory Domain Services (AD DS).
  • Вы хотите повысить доступность пространства имен путем использования отказоустойчивого кластера. You want to increase the availability of the namespace by using a failover cluster.
  • Вам необходимо создать одно пространство имен, которое будет содержать более 5000 папок DFS в домене и которое не соответствует требованиям к доменному пространству имен (режим Windows Server 2008), как описано ниже в этом разделе. You need to create a single namespace with more than 5,000 DFS folders in a domain that does not meet the requirements for a domain-based namespace (Windows Server 2008 mode) as described later in this topic.

Чтобы проверить размер пространства имен, щелкните правой кнопкой мыши пространство имен в дереве консоли управления DFS, выберите Свойства и просмотрите размер пространства имен в диалоговом окне Свойства. To check the size of a namespace, right-click the namespace in the DFS Management console tree, click Properties, and then view the namespace size in the Namespace Properties dialog box. Дополнительные сведения о масштабируемости пространств имен DFS см. на веб-сайте Майкрософт: Файловые службы. For more information about DFS Namespace scalability, see the Microsoft website File Services.

Читайте также:  Как проверить жесткий диск не загружая windows

Выбирайте доменное пространство имен, если в вашей среде выполняется какое-либо из следующих условий: Choose a domain-based namespace if any of the following conditions apply to your environment:

  • Вы хотите обеспечить доступность пространства имен путем использования нескольких серверов пространства имен. You want to ensure the availability of the namespace by using multiple namespace servers.
  • Вы хотите скрыть имя сервера пространства имен от пользователей. You want to hide the name of the namespace server from users. Это упрощает замену сервера пространства имен или перенос пространства имен на другой сервер. This makes it easier to replace the namespace server or migrate the namespace to another server.

Выбор режима доменного пространства имен Choosing a domain-based namespace mode

Если вы выбрали доменное пространство имен, необходимо выбрать, какой режим будет использоваться: режим Windows 2000 Server или режим Windows Server 2008. If you choose a domain-based namespace, you must choose whether to use the Windows 2000 Server mode or the Windows Server 2008 mode. Режим Windows Server 2008 предусматривает поддержку перечисления на основе доступа и повышенную масштабируемость. The Windows Server 2008 mode includes support for access-based enumeration and increased scalability. Доменное пространство имен, впервые появившееся в Windows 2000 Server, теперь называется «доменное пространство имен (режим Windows 2000 Server)». The domain-based namespace introduced in Windows 2000 Server is now referred to as «domain-based namespace (Windows 2000 Server mode).»

Для использования режима Windows Server 2008 домен и пространство имен должны удовлетворять следующим минимальным требованиям: To use the Windows Server 2008 mode, the domain and namespace must meet the following minimum requirements:

  • Режим работы леса — Windows Server 2003 или более высокий. The forest uses the Windows Server 2003 or higher forest functional level.
  • Режим работы домена — Windows Server 2008 или более высокий. The domain uses the Windows Server 2008 or higher domain functional level.
  • Все серверы пространства имен работают под управлением Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 или Windows Server 2008. All namespace servers are running Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, or Windows Server 2008.

Если ваша среда это поддерживает, выбирайте при создании новых доменных пространств имен режим Windows Server 2008. If your environment supports it, choose the Windows Server 2008 mode when you create new domain-based namespaces. Этот режим предоставляет дополнительные возможности и масштабируемость, а также исключает возможную необходимость в переносе пространства имен из режима Windows 2000 Server. This mode provides additional features and scalability, and also eliminates the possible need to migrate a namespace from the Windows 2000 Server mode.

О том, как перенести пространство имен в режим Windows Server 2008, см. в разделе Перенос доменного пространства имен в режим Windows Server 2008. For information about migrating a namespace to Windows Server 2008 mode, see Migrate a Domain-based Namespace to Windows Server 2008 Mode.

Если ваша среда не поддерживает доменные пространства имен в режиме Windows Server 2008, используйте для пространства имен существующий режим Windows 2000 Server. If your environment does not support domain-based namespaces in Windows Server 2008 mode, use the existing Windows 2000 Server mode for the namespace.

Сравнение типов и режимов пространств имен Comparing namespace types and modes

В следующей таблице приведены характеристики каждого типа и режима пространств имен. The characteristics of each namespace type and mode are described in the following table.

Оцените статью