Active Directory Users and Computers (ADUC) lets you take care of user accounts, groups, and other stuff in Active Directory (AD) through a nice visual setup. In the past, to get this tool, you had to download something called the Remote Server Administration Tools (RSAT) separately. But now, if you’re using Windows 11 or Windows 10, you don’t have to do that. RSAT is part of the “Features on Demand,” so you can just add it straight from the system itself.
This guide will show you how to add RSAT Active Directory Users and Computers and the Active Directory PowerShell module using either PowerShell or Command Prompt.
Install Active Directory Users and Computers in Windows 11 or 10 via PowerShell
PowerShell is likely the easiest way to add different features in Windows thanks to its easy yet powerful commands. The following steps will show you how to use it to install Active Directory Users and Computers on your Windows 11 or 10 PC.
- First, you need to open PowerShell as an admin. Press the Windows key, type “PowerShell,” right-click on “Windows PowerShell,” and pick “Run as administrator”.
- Make sure your PC is online before you start adding features with PowerShell.
- To add ADUC, type in this command:
Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools
- After you run the command, it will check with Windows Update to download and add what’s needed. You’ll see a message when it’s done.
It’s okay to skip adding a version number when you run the command. If you don’t add it, Windows will just get the newest version available.
Also see: Run CMD, PowerShell or Regedit as SYSTEM in Windows 11
Install Active Directory PowerShell Module
The Active Directory PowerShell Module is very useful for managing AD right from the command line. But it doesn’t come with the ADUC GUI tools, so you need to install it separately.
- Open PowerShell as an admin and run this command:
Add-WindowsCapability -Online -Name Rsat.AD.PowerShell
- Wait a bit, and you’ll see a message saying it’s done.
- Right after installing, you can start using the AD commands in your current session by typing:
Import-Module ActiveDirectory
This loads the Active Directory module so you can use commands like
Get-ADUser
andGet-ADComputer
for AD tasks.
Useful tip: How to Install Telnet via CMD or PowerShell in Windows 11
Install ADUC in Windows 11 or 10 via CMD
Although PowerShell is amazing for a lot of Windows admin tasks, some users might still prefer to use the old-school Command Prompt (CMD). Even though CMD doesn’t have as many fancy commands as PowerShell, you can still use DISM (Deployment Image Servicing and Management) to add features like ADUC.
- Open Command Prompt as an admin by pressing the Windows key, typing “cmd,” right-clicking on “Command Prompt,” and picking “Run as administrator”.
- Being online is important here too, since the features come from Windows Update.
- To add ADUC with CMD, enter this command:
dism /online /add-capability /capabilityname:Rsat.ActiveDirectory.DS-LDS.Tools
This also reaches out to Windows Update to download and add what you need. You’ll know it’s done when you see a message.
- If you want the Active Directory PowerShell Module too, use this command:
dism /online /add-capability /capabilityname:Rsat.AD.PowerShell
After that, you’re set to use the AD-specific commands in PowerShell.
Just like with PowerShell, you don’t have to specify a version number. Leaving it out means Windows will pick the latest version for you.
Related resource: Using PowerShell to Test Port Connection Without Telnet
What to do after installing them
After you’ve added ADUC, below are some tips to get familiar with it and make sure everything’s running as intended.
Launch ADUC
Press Windows + R, type “dsa.msc”, and hit Enter. This opens the Active Directory Users and Computers interface.
Connect to a Domain or a specific Domain Controller
If your PC is part of an Active Directory domain, ADUC will usually find a domain controller by itself. But if you need to hook up to a different domain, right-click on “Active Directory Users and Computers” at the top left and pick “Change Domain”.
For connecting to a specific domain controller in your current domain, choose “Change Domain Controller”.
Trying out ADUC
Take some time to check out the different areas and organizational units (OUs) in the domain. This is where you manage all the users, groups, computers, and more.
PowerShell module
If you added the Active Directory PowerShell module, open PowerShell and type Import-Module ActiveDirectory
to dive into using Active Directory commands.
Some common issues when installing ADUC
In most cases, there shouldn’t be any problem if you add ADUC using one of the ways described above. Below are some common problems you might see when installing ADUC and how to fix them.
Installation failures
Check you’re online since some parts might need to come from Windows Update. Make sure you have admin rights to run the commands.
ADUC not connecting to domain
Check your PC’s connection to the domain controller.
Make sure your domain login details are correct; you might need more rights to see or change certain things.
Missing tabs or features in ADUC
If you’re missing some options, it might be because you need more Windows features or the right permissions in Active Directory. For instance, the “Attribute Editor” tab shows up only if “Advanced Features” is turned on from the “View” menu.
PowerShell module errors
Double-check you’ve got the Rsat.AD.PowerShell
feature added. Make sure you’re using PowerShell with admin rights too.
Some final notes
Usually, tools like Active Directory Users and Computers are set up on client PCs, not directly on servers. If you’re adding Active Directory Users and Computers to a client machine, the normal way is through the system settings: “Settings” > “Apps” > “Optional features”. This method is pretty straightforward and what most users would use because it’s visual and easy to understand.
But, if you’re looking to add ADUC through the command line, either using PowerShell or Command Prompt, this guide will be of help for that. You should try these things on a test machine first before using them in a work environment.
Any Windows Server administrator must have used the Active Directory Users and Computers (ADUC) Microsoft Management Console on a Domain Controller (DC). Using this console, you can control and manage users, user groups, computers, and the Organizational Units (OUs) in the domain.
The ADUC console is no longer limited to servers anymore. You can install the Active Directory Users and Computers snap-in on a Windows 11 or Windows 10 computer as well, which performs the same functions as the original Server console. This snap-in is part of the Remote Server Administration Tools (RSAT) for Windows operating systems.
We have written separate posts for installing any RSAT tools on Windows 11 and Windows 10. This article focuses on installing specifically the Active Directory Users and computers snap-in on a Windows PC and then using it to manage your domain.
Table of Contents
How to Install Active Directory Users and Computers (ADUC) on Windows
All RSAT tools, including the Active Directory Users and Computers snap-in, allow you to manage the different Active Directory components as if you are on the server itself. This way, you do not always have to access the server, neither physically nor remotely, to perform an action.
You can download and install the Active Directory Users and Computers snap-in using the Settings app, from the Command Prompt, and Windows PowerShell.
Note: On Windows 10 v1803 and older, you must download and install all RSAT tools using the MSI files. You can find the MSI files for your version of Windows here.
Install Active Directory Users and Computers from Settings App
The easiest way to install the ADUC snap-in on a Windows PC is from the settings app. It does involve more steps than the other methods shared below, but this is the only method using the Windows GUI.
Use these steps to install the ADUC snap-in from the Settings app:
-
Navigate to the following:
Settings app >> Apps >> Optional Features
-
Click “View features.”
Add an optional feature -
Search for “Active Directory,” select “RSAT: Active Directory Domain Services and Lightweight Directory Services Tools,” and click Next.
Select Active Directory Users and Computers -
Click “Install.”
Install Active Directory Users and Computers from the Settings app -
Once installed, restart the computer.
The Active Directory Users and Computers snap-in will now be installed. If you prefer installing it using the command line, refer to the sections below. To learn how to use the snap-in, continue reading down.
Install Active Directory Users and Computers from Command Prompt
Below are the simple steps to install Active Directory Users and Computers snap-in using the Command Prompt:
-
Open an elevated Command Prompt instance.
-
Run the following command:
DISM /Online /Add-Capability /CapabilityName:Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
Install Active Directory Users and Computers snap-in using Command Prompt
The ADUC snap-in should now be installed. Run the following command in Command Prompt to confirm that the Active Directory Users and Computers snap-in has been installed:
DISM.exe /Online /Get-CapabilityInfo /CapabilityName:Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
You should see “Installed” in front of Status.
Install Active Directory Users and Computers from PowerShell
Use the following steps to install the Active Directory Users and Computer snap-in using PowerShell:
-
Launch an elevated PowerShell instance.
-
Run the following command to install ADUC:
Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
Install Active Directory Users and Computers snap-in using PowerShell
The ADUC snap-in should now be installed. To confirm its status, run the following command in PowerShell:
Get-WindowsCapability -Online | Where-Object {$_.Name -like "RSAT.ActiveDirectory*"}
You should see “Installed” in front of State.
These are all the methods to install the Active Directory Users and Computers snap-in on a Windows 11/10 PC. Let us now continue to see how to use this tool.
How to Use Active Directory Users and Computers
How to Open Active Directory Users and Computers Snap-In
Now that Active Directory Users and Computers is installed, you can open it by searching for it in the Start menu, or running the following in the Run Command box:
dsa.msc
Alternatively, you can also open the ADUC snap-in through the Control Panel at the following location:
Control Panel >> System and Security >> Windows Tools
If your computer is connected to a domain and you are logged in from an authorized domain account, then the ADUC snap-in will automatically connect to the server. However, if one is not connected, then you must connect to the Domain Controller.
Connect ADUC to Domain Controller
Use these steps to connect to a Domain Controller. You can also use these to change your domain/Domain Controller.
-
From the ADUC console, click “Action,” and then click “Change Domain Controller.”
Change or connect to Domain Controller The Change Directory Server window will now open.
-
Select the “This Domain Controller or AD LDS instance” radio button, then select the Domain Controller from the give list and click Ok.
Select and connect to Domain Controller
The ADUC will now connect to the Domain Controller and populate the fields.
Now that you are connected to the Domain Controller, you can now begin making changes and managing the different components of the domain.
Manage Users, Computers, Organizational Unit using ADUC
You can now begin adding new users, computers, printers, and Organizational Units to the domain. Simply right-click on the OU that you want to add the new device/user to, expand “New”, and select the element that you want to add.
Once you have selected the element to add, the respective window will open, where you can then configure the component to add.
You can now also use other operators to manage the users, devices, and other elements configured inside the domain directly from your Windows PC.
Additionally, you can also manage what you see inside the snap-in. Click “View” from the top menu and select the things that you want to see. You can then also click “Filter options” to open the advanced viewing options.
The list does not end here. There are a bunch of other management options you can perform directly from the ADUC snap-in on a Windows PC. We suggest that you play around to discover all the options. However, we advise caution and only use the console if you know what you are doing.
What is Active Directory Users and Computers Used For
By now, we have a pretty good understanding of what the ADUC snap-in can be used for. However, there is more to it than meets the eye. The Active Directory Users and Computers RSAT tool can be used to perform the following actions:
- Create and manage user accounts, computers, and Active Directory groups.
- View and edit AD object attributes with ADSI Edit.
- Search for AD objects.
- Change or reset user password in Active Directory.
- Create organizational units and build hierarchical structures for AD objects. You can also delegate administrative permission on these OUs to other domain users.
- Delegate administrative permissions.
- Raise domain functional level, and transfer FSMO roles with PowerShell to another domain controller.
From this, it is understood how useful the ADUC snap-in is for administrators that use Windows client PCs.
Successfully Tested On: Windows 11 Enterprise versions 21H2 – 24H2, Windows 10 Enterprise versions 1809 – 21H2, Windows 10 Long-Term Servicing Channel (LTSC) version 2019
Microsoft has changed the way Remote Server Administration Tools (RSAT) get installed a few times with Windows 10. In previous years it was a simple download from the Microsoft Download Center, but those simple times are long gone.
Microsoft’s current recommended method involves using “Features on Demand” by going to Windows Settings > Apps > Optional Features > Add a Feature. This method works well most of the time, but depending on how Windows is configured, particularly with WSUS, it may not work for everyone.
Conveniently the Add-WindowsCapability PowerShell cmdlet (part of DISM) lets us install with a simple one-line command. Open PowerShell as administrator and run the following:
Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
The install may take a few minutes to run, and progress should show in the prompt:
The prompt shouldn’t report any errors if successful:
RSAT’s Active Directory Users and Computers tool will now be available in all programs under the Windows Administrative Tools folder.
Любой системный администратор Windows должен уметь пользоваться не только графическими оснастками AD (чаще всего это ADUC – Active Directory Users and Computer), но и командлетами PowerShell для выполнения повседневных задач администрирования Active Directory. Чаще всего для администрирования домена, управления объектами (пользователями, компьютерами, группами) используется модуль Active Directory для Windows PowerShell. В этой статье мы рассмотрим, как установить модуль RSAT-AD-PowerShell, его базовый функционал и популярные командлеты, которые должны быть полезными при управлении и работе с AD.
Содержание:
- Как установить модуль Active Directory для PowerShell в Windows 10 и 11?
- Установка модуля RSAT-AD-PowerShell в Windows Server
- Основные командлеты модуля Active Directory для PowerShell
- Импорт модуля Active Directory PowerShell с удаленного компьютера
- Администрирование AD с помощью модуля Active Directory для PowerShell
Как установить модуль Active Directory для PowerShell в Windows 10 и 11?
Вы можете установить модуль RSAT-AD-PowerShell не только на серверах, но и на рабочих станциях. Этот модуль входит в состав пакета RSAT (Remote Server Administration Tools) для Windows.
В современных билдах Windows 11 и Windows 10 компоненты RSAT устанавливаются онлайн в виде Features on Demand. Вы можете установить модуль с помощью команды:
Add-WindowsCapability -online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
Или через панель Settings -> Apps -> Optional features -> Add a feature -> RSAT: Active Directory Domain Services and Lightweight Directory Services Tools.
Для предыдущих версий Windows пакет RSAT нужно было качать и устанавливать вручную. После этого нужно активировать модуль AD для PowerShell из панели управления (Control Panel -> Programs and Features -> Turn Windows features on or off -> Remote Server Administration Tools-> Role Administration Tools -> AD DS and AD LDS Tools).
Для использования командлетов AD в PowerShell Core 6.x, 7.x сначала нужно установить модуль WindowsCompatibility:
Install-Module -Name WindowsCompatibility
Затем загрузите модуль в сессию с помощью команд:
Import-Module -Name WindowsCompatibility
Import-WinModule -Name ActiveDirectory
Теперь вы можете использовать командлеты AD в ваших скриптах на PowerShell Core 7.
Установка модуля RSAT-AD-PowerShell в Windows Server
В Windows Server вы можете установить модуль Active Directory для Windows PowerShell из графической консоли Server Manager или с помощью PowerShell.
Вы можете проверить, что модуль Active Directory установлен с помощью команды:
Get-WindowsFeature -Name «RSAT-AD-PowerShell»
Если модуль отсутствует, установите его:
Install-WindowsFeature -Name "RSAT-AD-PowerShell" –IncludeAllSubFeature
Для установки модуля через панель управления Server Manager, перейдите в Add Roles and Features -> Features -> Remote Server Administration tools -> Role Administration Tools -> AD DS and AD LDS Tools -> выберите Active Directory module for Windows PowerShell.
Не обязательно использовать контроллер домена для администрирования Active Directory с помощью модуля RSAT-AD-PowerShell. Этот модуль можно установить на любом сервере или рабочей станции. На контроллерах домена AD модуль устанавливается автоматически при развертывании роли ADDS (при повышении сервера до DC).
Модуль взаимодействует с AD через службу Active Directory Web Services, которая должна быть запущена на контроллере домена и доступна клиентам по порту TCP 9389. Проверьте, что порт доступен на DC с помощью командлета Test-NetConnection:
tnc MSK-DC01 -port 9389
Основные командлеты модуля Active Directory для PowerShell
В модуле Active Directory для Windows PowerShell имеется большое командлетов для взаимодействия с AD. В текущей версии модуля для Windows Server 2022/Windows 11 доступно 147 PowerShell командлетов для AD.
Проверьте, что модуль установлен на компьютере:
Get-Module -Name ActiveDirectory –ListAvailable
Перед использованием командлетов модуля, его нужно импортировать в сессию PowerShell (начиная с Windows Server 2012 R2/ Windows 8.1 и выше модуль импортируется автоматически):
Import-Module ActiveDirectory
Проверьте, что модуль AD загружен в вашу сессию PowerShell:
Get-Module
Вы можете вывести полный список доступных командлетов с помощью команды:
Get-Command –module activedirectory
Общее количество команд в модуле:
Get-Command –module activedirectory |measure-object
Большинство командлетов модуля RSAT-AD-PowerShell начинаются с префикса Get-, Set-или New-.
- Командлеты класса Get— используются для получения различной информации из AD (Get-ADUser — свойства пользователей, Get-ADComputer – параметры компьютеров, Get-ADGroupMember — состав групп и т.д.). Для их выполнения не нужно быть администратором домена, любой пользователь домена может выполнять скрипты PowerShell для получения значений большинства атрибутов объектов AD (кроме защищенных, как в примере с LAPS).
- Командлеты класса Set— служат для изменения параметров объектов в AD, например, вы можете изменить свойства пользователя (Set-ADUser), компьютера (Set-ADComputer), добавить пользователя в группу и т.д. Для выполнения этих операций у вашей учетной записи должны быть права на объекты, которые вы хотите изменить (см. статью Делегирование прав администратора в AD).
- Команды, начинающиеся с New- позволяют создать объекты AD: создать пользователя — New-ADUser, группу — New-ADGroup, создать Organizational Unit — New-ADOrganizationalUnit.
- Командлеты, начинающиеся с Add—: добавить пользователю в группу (Add-ADGroupMember), создать гранулированные политики паролей (Add-ADFineGrainedPasswordPolicySubject);
- Командлеты Remove— служат для удаления объектов AD (Remove-ADGroup, Remove-ADComputer, Remove-ADUser).
Есть специфические командлеты PowerShell для управления только определенными компонентами AD:
-
Enable-ADOptionalFeature
– включить компоненты AD (например, корзину AD для восстановления удаленных объектов) -
Install-ADServiceAccount
– настроить учетную запись для службы (MSA, gMSA) -
Search-ADAccount
– позволяет найти в AD отключенные, неактивные, заблокированные учетные записи пользователей и компьютеров -
Enable-ADAccount
/
Disable-ADAccount
/
Unlock-ADAccount
– включить/отключить/ разблокировать учетную запись
По умолчанию командлеты PowerShell подключаются к вашему ближайшему контроллеру в вашем домене (LOGONSERVER). С помощью параметра -Server вы можете подключиться к ADDS на другом контроллере домена или в другом домене (список DC в другом домене можно вывести с помощью команды
nltest /dclist:newdomain.com
). Параметр -Server доступен почти для всех командлетов модуля. Например:
Get-ADuser aaivanov -Server msk-dc01.winitpro.ru
Также вы можете указать учетную запись для подключения к AD с помощью параметра -Credential.
$
creds = Get-Credential
Get-ADUser -Filter * -Credential $creds
Получить справку о любом командлете можно так:
get-help New-ADComputer
Примеры использования командлетов Active Directory можно вывести так:
(get-help Set-ADUser).examples
В PowerShell ISE при наборе параметров командлетов модуля удобно использовать всплывающие подсказки.
Импорт модуля Active Directory PowerShell с удаленного компьютера
Не обязательно устанавливать модуль AD PowerShell на все компьютеры. Администраора может удаленно импортировать это модуль с контроллера домена (нужны права администратора домена) или с любого другого компьютера.
Для подключения к удаленном компьютеру исопьзуется PowerShell Remoting. Это требует, чтобы на удаленном компьютере был включен и настроен Windows Remote Management (WinRM).
Создайте новую сесиию с удаленнм компьютером, на котором установлен модуль AD PowerShell:
$rs = New-PSSession -ComputerName DC_or_Comp_with_ADPosh
Импортируйте модуль ActiveDirectory с удаленного компьютера в вашу локальную сессию:
Import-Module -PSsession $rs -Name ActiveDirectory
Теперь вы можете выполнять любые команды из модуля Active Directory на своем компьютере, как будто это модуль установлен локально. При этом они выполняются на удаленном хосте.
Вы можете добавить эти команды в ваш файл профиля PowerShell (например,
notepad $profile.CurrentUserAllHosts
), чтобы автоматически импортировать модуль из удаленной сессии при запуске консоли powershell.exe.
Завершить удалённую сессию можно командой:
Remove-PSSession -Session $rs
Этот же способ с импортом модуля AD через PoweShell implicit remoting позволит вам использовать командлеты PowerShell с хостов Linux and macOS, на которые нельзя установить локальную копию модуля.
Также вы можете использовать модуль Active Directory для PowerShell без установки RSAT. Для этого достаточно скопировать с компьютера с установленным модулем RSAT-AD-PowerShell:
- Каталог C:\Windows\System32\WindowsPowerShell\v1.0\Modules
- Файл ActiveDirectory.Management.dll
- Файл ActiveDirectory.Management.resources.dll
Затем нужно импортировать модуль в сессию:
Import-Module C:\path\Microsoft.ActiveDirectory.Management.dll
Import-Module C:\path\Microsoft.ActiveDirectory.Management.resources.dll
После этого вы можете использовать все командлеты из модуля AD без установки RSAT.
Администрирование AD с помощью модуля Active Directory для PowerShell
Рассмотрим несколько типовых задач администратора, которые можно выполнить с помощью команд модуля AD для PowerShell.
Полезные примеры использования различных командлетов модуля AD для PowerShell уже описаны на сайте. Следуйте ссылкам по тексту за подробными инструкциями.
New-ADUser: Создать пользователя в AD
Для создания нового пользователя в AD используется использовать командлет New-ADUser. Создать пользователя можно командой:
New-ADUser -Name "Andrey Petrov" -GivenName "Andrey" -Surname "Petrov" -SamAccountName "apetrov" -UserPrincipalName "[email protected] " -Path "OU=Users,OU=Ufa,DC=winitpro,DC=loc" -AccountPassword(Read-Host -AsSecureString "Input Password") -Enabled $true
Более подробно о команде New-ADUser (в том числе пример массового создания учетных записей в домене) читайте в статье .
Get-ADComputer: Получить информацию о компьютерах домена
Чтобы вывести информацию о компьютерах в определённом OU (имя компьютера и дата последней регистрации в сети) используйте командлет Get-ADComputer:
Get-ADComputer -SearchBase ‘OU=Russia,DC=winitpro,DC=ru’ -Filter * -Properties * | FT Name, LastLogonDate -Autosize
Add-AdGroupMember: Добавить пользователя в группу AD
Чтобы добавить пользователей в существующую группу безопасности в домене AD, выполните команду:
Add-AdGroupMember -Identity MskSales -Members apterov, divanov
Вывести список пользователей в группе AD и выгрузить его в файл:
Get-ADGroupMember MskSales -recursive| ft samaccountname| Out-File c:\script\export_users.csv
Более подробно об управлении группами AD из PowerShell.
Set-ADAccountPassword: Сброс пароля пользователя в AD
Чтобы сбросить пароль пользователя в AD из PowerShell, выполните:
Set-ADAccountPassword apterov -Reset -NewPassword (ConvertTo-SecureString -AsPlainText “P@ssw0rd1” -Force -Verbose) –PassThru
Блокировка/разблокировка пользователя
Отключить учетную запись:
Disable-ADAccount apterov
Включить учетную запись:
Enable-ADAccount apterov
Разблокировать аккаунт после блокировки парольной политикой:
Unlock-ADAccount apterov
Search-ADAccount: Поиск неактивных компьютеров в домене
Чтобы найти и заблокировать в домене все компьютеры, которые не регистрировались в сети более 100 дней, воспользуйтесь командлетом Search-ADAccount:
$timespan = New-Timespan –Days 100
Search-ADAccount -AccountInactive -ComputersOnly –TimeSpan $timespan | Disable-ADAccount
New-ADOrganizationalUnit: Создать структуру OU в AD
Чтобы быстро создать типовую структуры Organizational Unit в AD, можно воспользоваться скриптом PowerShell. Допустим, нам нужно создать несколько OU с городами, в которых создать типовые контейнеры. Вручную через графическую консоль ADUC такую структуру создавать довольно долго, а модуль AD для PowerShell позволяет решить такую задачу за несколько секунд (не считая время на написание скрипта):
$fqdn = Get-ADDomain
$fulldomain = $fqdn.DNSRoot
$domain = $fulldomain.split(".")
$Dom = $domain[0]
$Ext = $domain[1]
$Sites = ("SPB","MSK","Sochi")
$Services = ("Users","Admins","Computers","Servers","Contacts")
$FirstOU ="Russia"
New-ADOrganizationalUnit -Name $FirstOU -Description $FirstOU -Path "DC=$Dom,DC=$EXT" -ProtectedFromAccidentalDeletion $false
foreach ($S in $Sites)
{
New-ADOrganizationalUnit -Name $S -Description "$S" -Path "OU=$FirstOU,DC=$Dom,DC=$EXT" -ProtectedFromAccidentalDeletion $false
foreach ($Serv in $Services)
{
New-ADOrganizationalUnit -Name $Serv -Description "$S $Serv" -Path "OU=$S,OU=$FirstOU,DC=$Dom,DC=$EXT" -ProtectedFromAccidentalDeletion $false
}
}
После выполнения скрипта у нас в AD появилась такая структура OU.
Для переноса объектов между контейнерами AD можно использовать командлет Move-ADObject:
$TargetOU = "OU=Buhgalteriya,OU=Computers,DC=corp,DC=winitpro,DC=ru"
Get-ADComputer -Filter 'Name -like "BuhPC*"' | Move-ADObject -TargetPath $TargetOU
Get-ADReplicationFailure: Проверка репликации в AD
С помощью командлета Get-ADReplicationFailure можно проверить состояние репликации между контроллерами домена AD:
Get-ADReplicationFailure -Target DC01,DC02
Получить информацию обо всех DC в домене с помощью командлета Get-AdDomainController:
Get-ADDomainController –filter * | select hostname,IPv4Address,IsGlobalCatalog,IsReadOnly,OperatingSystem | format-table –auto
В этой статье мы рассмотрели, как установить и использовать модулья AD PowerShell для администрирования домена. Надеюсь, эта статья подтолкнет вас к дальнейшему исследованию возможностей этого модуля и автоматизации большинства задач управления AD.
If you’re a Windows admin using a Microsoft Windows 11, 10, or 8 computer, you may want to install Active Directory Users and Computers as well as other Active Directory applications. These tools are not installed by default, but here’s how to get them.
Note: You can install Remote Server Administration Tools for Windows only on the full release of Windows Professional or Windows Enterprise. Otherwise, you will receive a “This update does not qualify for your computer.” message when you try to install it.
Contents
- 1 Windows 11
- 1.1 Install From Settings
- 1.2 Install Using PowerShell
- 2 Windows 10 Version 1809 and Higher
- 3 Windows 8 and Windows 10 Version 1803 or Lower
Install From Settings
- Select Start > Settings.
- Choose Apps > Optional features.
Install Using PowerShell
- Right-click on the Start button and choose Windows PowerShell (Admin).
- Type the following, then press Enter:
Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property DisplayName, State
Windows 10 Version 1809 and Higher
As of Windows 10 1809, RSAT is no longer installed using the installer from Microsoft, it is now available as a feature. Use these steps to install it.
- Right-click the Start button and choose “Settings” > “Apps” > “Manage optional features” > “Add feature“.
- Select “RSAT: Active Directory Domain Services and Lightweight Directory Tools“.
- Select “Install“, then wait while Windows installs the feature. It should eventually appear as an option under “Start” > “Windows Administrative Tools“.
Windows 8 and Windows 10 Version 1803 or Lower
- Download and install one of the following depending on your version of Windows:
- Remote Server Administrator Tools For Windows 10
- Remote Server Administrator Tools For Windows 8
- Remote Server Administrator Tools For Windows 8.1
- In Windows 8 and older versions of Windows 10, right-click the Start button and choose “Control Panel” > “Programs” > “Programs and Features” > “Turn Windows features on or off“.
- Scroll down and expand the “Remote Server Administration Tools” section.
- Expand “Role Administration Tools“.
- Expand “AD DS and AD LDS Tools“.
- Ensure that “AD DS Tools” is checked, then select “OK“.
- You should have an option for “Administrative Tools” on the Start menu. From there, select any of the Active Directory tools. In newer versions of windows 10 (or at least mine), select the “Start” button then type “active directory”, and it should show up.
Author Mitch Bartlett
Through my career that spans over 20 years I have become an expert in Microsoft Systems Administration, Android, and macOS. I started this site as a technical guide for myself and it has grown into what I hope is a useful knowledgebase for everyone.