In this second part we will install Active Directory Domain Services in our DC virtual machine.
If you logged-on to your VMs you might have notice that the IP assigned to each VM is 192.168.4.4 for the first VM (the Domain controller) and 192.168.4.5 to the Exchange VM. However if you shutdown your VMs and start them in different orders the IP address will change. Therefore to avoid this and before doing anything else, let us connect to our Azure account by PowerShell and set static IP addresses to our VMs.
To connect to your azure account using PowerShell, first we need to install “Azure PowerShell”. To do this just open PowerShell (version 1.3.0 or higher) as Administrator, and run the following commands:
# Install the Azure Resource Manager modules Install-Module AzureRM # Install the Azure Service Management module Install-Module Azure
Verify that the “Execution Policy” is set to RemoteSigned:
# Check Execution Policy Get-ExecutionPolicy # Change Execution Policy Set-ExecutionPolicy RemoteSigned
To connect to your Azure account run the following command:
Enter the email and password you used to subscribe to Azure, and click Sign in. If you have problems signing in to your azure account try connecting with the following command:
Add-AzureAccount –TenantId 'xxxxx-yyy-xxx-aaa-zzzzzz'
(Note: If you don’t know your tenant ID you can find it on your Azure management portal, and navigate to Active Directory, Default Directory. The tenant ID is the one that appears on the URL.)
To verify that we can use cmdlet for Azure run the following command:
# To view all subscriptions for your account Get-AzureSubscription
You will see the following Information for each Azure subscription you have:
SubscriptionId : 1111111-0000-bbbb-5555-ffffffffff SubscriptionName : Subscription_Name Environment : AzureCloud DefaultAccount : firstname.lastname@example.org IsDefault : True IsCurrent : True TenantId : xxxxx-yyy-xxx-aaa-zzzzzz CurrentStorageAccountName :
To see the list of VMs on your subscription run:
If the subscription you used to create your VMs for this lab is not the default subscription (on the subscription information you will see IsDefault : False). You can select a default subscription with the following command:
Select-AzureSubscription –SubscriptionName 'Subscription_Name'
You can verify your selected the right subscription by getting the List of VMs for that subscription (Get-AzureVM), you will get the following info:
ServiceName Name Status ----------- ---- ------ VLabDC VLabDC1 ReadyRole VLabEX VLab08EX ReadyRole
Finally to set the Static IP address to your VMs run the following command:
Get-AzureVM -ServiceName 'VLabDC' -Name 'VLabDC1' | Set-AzureStaticVNetIP -IPAddress 192.168.4.4 | Update-AzureVM
If succeed you will get the following info:
OperationDescription OperationId OperationStatus -------------------- ----------- --------------- Update-AzureVM aaaaaa-bbbb-aaaa-bbbb-eeeeeee Succeeded
Do the same for both VMs. Notice that in the VM’s Local Area Connection info will still show IPv4 address assigned by DHCP, however it will receive the same IP every time you start your VM.
Now that we set the VM’s IP addresses let us continue by installing Active Directory Domain Services in our DC virtual Machine.
To connect to our VM, from the Azure Management Portal navigate to VIRTUAL MACHINES, and select (highlight) your DC VM. Then on the lower pane click on CONNECT, an in-browser dialog box will open asking you to Open, Save or Cancel. Click Save.
After clicking Connect the Windows Security windows will open. In there you have to write the VM credentials (the ones that you configure when creating the VM). Write the VM_Name\User_Name and the password of your VM and click OK.
Installing Active Directory Domain Service (AD DS)
Before we proceed with the installation of AD DS, first let us verify the IP and DNS configuration of our computer. In PowerShell run the command ipconfig /all, verify that the IP address is the one you assigned to the DS VM and that the DNS server IP address is the correct one.
After we confirm the IP configuration is the right one, we can proceed. Installing AD DS in Windows server 2008 R2 is very similar to doing the same in Windows Server 2012 or 2016. So to start, first open the Server Manager.
On the Server Manager, you now can see Active Directory Domain Services, under Roles on the Right pane. Click on it, and on the main panel under Summary, click on Run the Active Directory Domain Services Installation Wizard (dcpromo.exe) to promote the server to a Domain Controller. The Active Directory Domain Services Installation Wizard will open.
On the Additional Domain Controller Options page, leave DNS server checked and click Next. You might receive a warning saying that you do not have a Static IP address, just ignore it and continue with the installation.
The Remote Desktop session will be closed once you reboot the server, connect again the same way explained above. However, this time when the Windows Security ask you for the credentials, instead of writing the VM_Name\User_Name write the Domain_Name\User_Name (The one you wrote as the Forest Root Doman name).
On the next post we will continue with the preparation for installing the Exchange server.