Install Active Directory with PowerShell : Windows server core edition utilize very low memory and saves lot of space to compared to GUI version. Server 2019 is available as Datacenter server core and standard server core. Let’s install Active directory in server 2019 server core edition.
Command prompt <-> PowerShell – We will be using Powershell for the entire process. Transformation from command prompt to PowerShell and viceversa is easy.
1.Planning for Active Directory install:Before promoting the server as Domain controller, change hostname (not mandatory but for our preference) and set static IP for the server.
Get-NetAdapter
#Get information of Network adapter
New-NetIPAddress -Interfacealias 'Ethernetname' -IPAddress 192.168.0.12 -PrefixLength 24 -DefaultGateway 192.168.0.1
Set-DnsClientServerAddress -InterfaceAlias 'Ethernetname' -ServerAddresses 127.0.0.1
Rename-computer -NewName “ikd00” -confirm -restart #Server Rename
2. Once the server is restarted, Install AD roles and features using ‘Install-windowsfeature’ cmdlet and ‘-includemanagementtools’ parameter for required features.
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools -Includeallsubfeatures
* Get-Windowsfeature is used to view list of installted roles & features.
3.Promote the server as domain controller: Next step is to promote the server as domain controller.
Install-ADDSForest -DomainName <Name of the domain>
Install-ADDSForest -DomainName itsmar05.local
4.Enter the safe mode password for DSRM. The password entered will be required during AD recovery mode.
Server will reboot automatically once the AD DS is installed.
5. After restart of server, the server is promoted as Domain controller of the domain – itsamar05.local .
6.Verify the AD services.
Get-Service ADWS,KDC,NETLOGON,DNS
7. Also verify the availability of SYSVOL and Netlogon shares.
Get-SMBShare