How to install Active Directory using Powershell
To support me, you can subscribe to the channel, share and like the videos, disable your ad blocker or make a donation. Thank you!
Third of four articles presenting different methods for installing Active Directory:
- Installing Microsoft Active Directory via the GUI (server 2012, 2012r2, 2016, 2019, 2022)
- Install Microsoft Active Directory via the dcpromo  command(server 2003, 2008, 2008r2, 2012, 2012r2, 2016, 2019, 2022)
- Install Microsoft Active Directory via Powershell (server 2012, 2012r2, 2016, 2019, 2022)
- Installing Microsoft Active Directory via Powershell DSC (server 2016, 2019, 2022)
Powershell code - Active Directory installation
# Installing the role.Add-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools
# Configuring the role$domaine = 'domaine.tld'$DsrmPass = 'P@ssword'
Import-Module ADDSDeployment$params = @{    CreateDnsDelegation           = $false    # 2 ou Win2003, 3 ou Win2008, 4 ou Win2008R2, 5 ou Win2012, 6 ou Win2012R2,7 ou WinThreshold    DomainMode                    = 'Win2012r2'    DomainName                    = $domaine    DomainNetbiosName             = $domaine.split('.')[0]    # 2 ou Win2003, 3 ou Win2008, 4 ou Win2008R2, 5 ou Win2012, 6 ou Win2012R2,7 ou WinThreshold    ForestMode                    = 'Win2012r2'    InstallDns                    = $true    DatabasePath                  = 'C:\Windows\NTDS'    LogPath                       = 'C:\Windows\NTDS'    SysvolPath                    = 'C:\Windows\SYSVOL'    NoRebootOnCompletion          = $false    Force                         = $true    SafeModeAdministratorPassword = (ConvertTo-SecureString -AsPlainText -Force -String $DsrmPass)}Install-ADDSForest @paramsVideo : How to install Active Directory using Powershell
Related links
- How to install Active Directory via the graphical interfaceFirst of four articles showcasing different methods for installing Active Directory
- How to join an Active Directory domain with PowerShell DSCHow to join an Active Directory domain with PowerShell DSC
- How to install Active Directory using PowershellThis is the third of four articles presenting different methods of installing Active Directory
- How to install Active Directory using the dcpromo commandSecond of four articles presenting different methods for installing Active Directory
- Fix an Active Directory sign-on approval relationship errorHow to fix a sign-on approval relationship error in Active Directory
- How to create a multiboot USB key with the Ventoy toolIt's useful to have a multiboot USB stick containing operating system images or troubleshooting tools that you can boot from if you need to