In previous post, we had created an Azure VM with Windows Server 2012 operating system under DNSSubnet in the VPN we created at the first post. In this post, I am planning to install active directory, which will be used for configuring SQL Server Mirroring.
One thing to note here, there is no prerequisite to have active directory for the web application which we are going to publish on the Web Server (next post). But, for SQL Server Mirroring require active directory user for configuration.
The following steps walkthrough the installation of Active Directory role.
Step 1: Connect to the VM (DNTDNSVM) and select Manage --> Add Roles and Features from the Server Manger window.
Step 2: The system will open the Add Roles and Features Wizard.
Press Next in the Before you begin screen.
Step 3: Select Role-based or feature-based installation option in the Select installation type screen.
Step 4: In the Select destination server screen, the VM created in the previous post (DNTDNSVM) will be selected by default.
Step 5: Select Active Directory Domain Service in the Select server roles screen.
On selection of Active Directory Domain Service item, the Add Roles and Features Wizard window will popup.
Press Add Features.
Press Next in the Select server roles screen.
Step 6: Press Next in the Select features screen.
Step 7: Press Next in the Active Directory Domain Service screen.
Step 8: Press Install in the Confirm installation selections screen.
The system will install Active Directory Domain Service in the server. You can close the window before completion also.
Installing domain controller
Step 1: Once the installation completed, it will show a message in the Server Manager. Press the message icon and select Promote this server to a domain controller link.
The system will open Deployment Configuration screen.
Step 2: Select Add a new forest option selected and type the domain name you prefer in the Root domain name field. For testing purpose, I enter TestAzureDC.com as domain name.
Step 3: Enter the password in the Domain Controller Options screen.
Step 4: As this is a new forest, no action required in the DNS Options screen.
Step 5: Press Next in the Addition Options screen.
Step 6: Leave the default path and press Next in the Paths screen.
Step 7: Review the summary and press Next.
The system will review the prerequisites and show you the result.
Step 8: If the Prerequisites Check is successful, press Install.
The system will install the DC and restart the server.
Step 9: Once the server restarted, login to the server with the AD user.
The VM will show in the RDP.
Installing from the PowerShell
We can even install DNS and AD from the PowerShell script. It will be easy to configure. So to install DNS and AD roles from the PowerShell, login to the VM (DNTDNSVM) and open the Windows PowerShell IDE from Server Manager --> Tools --> Windows PowerShell ISE. Run the following script.
##Installing AD-DS Import-Module ServerManager Install-WindowsFeature -Name AD-Domain-Services -ComputerName DNTDNSVM -IncludeAllSubFeature -IncludeManagementTools -Restart ##Installing AD DS New AD Forrest Import-Module ADDSDeployment Install-ADDSForest -DomainName "testazuredc.com" -InstallDns:$true ` -CreateDnsDelegation:$false ` -DatabasePath "C:\Windows\NTDS" ` -DomainMode "Win2012" ` -DomainNetbiosName "TESTAZUREDC" ` -ForestMode "Win2012" -LogPath "C:\Windows\NTDS" ` -NoRebootOnCompletion:$false ` -SysvolPath "C:\Windows\SYSVOL" ` -Force:$true Test-ADDSForestInstallation -DomainName "testazuredc.com" -NoRebootOnCompletion
While running this script, it will ask the password for the Active Directory Administrator user. Provide the password and confirm.
Once this script ran, it will restart the server. Login with the server with the domain user credential as discussed before.