Thursday, September 27, 2012

Domain Controller demotion by PowerShell on Windows Server 2012

I will  demote a domain controller by PowerShell on Windows Server 2012.

Assuming that there is 1 domain controller named DC01 in "contoso.com" domain.

1. On DC01, log in as Domain Administrator.
2. Launch "PowerShell".
3. Perform "Test-ADDSDomainControllerUninstallation -LastDomainControllerInDomain -RemoveApplicationPartitions | ft -Wrap".
4. Provide a new local administrator password.


The status is "Success".

Remark: Before the domain controller is demote, we can perform  "Test-ADDSDomainControllerUninstallation" cmdlet to runsome prerequisites check in your domain environment.  "Test-ADDSDomainControllerUninstallation" is a new cmdlet in Windows Server 2012.

5. Perform "Uninstall-ADDSDomainController -LastDomainControllerInDomain -RemoveApplicationPartitions".
6. Provide a new local administrator password for DC01.


7. Enter "Y" to continue with this operation.


Now, DC01 is demoting the AD DS. When the demotion finished, DC01 will restart automatically.

As a result, DC01 was demoted.

Remark: To force removal a domain controller by PowerShell, perform "Uninstall-ADDSDomainController -ForceRemoval -DemoteOperationsMasterRole".


This posting is provided “AS IS” with no warranties, and confers no rights!

Wednesday, September 26, 2012

Domain Controller demotion on Windows Server 2012 and Windows Server 2012 R2

On Windows Server 2012, administrators cannot perform "dcpromo" to demote a domain controller. To demote a domain controller, administrators can use "Server Manager" or "PowerShell".

I will demote a domain controller on Windows Server 2012 by GUI.

Assuming that there is 1 domain controller named DC01 in "fabrikam.com" domain.

1. On DC01, log in as Domain Administrator.
2. Launch "Server Manager".


3. On "Server Manager", click "Manage".


4. Select "Remove Roles and Features".
5. On "Before you begin" screen, click "Next".
6. On "Server Selection" screen, select "DC01.fabrikam.com".


7. Click "Next".
8. On "Server Roles" screen, clear the "Active Directory Domain Services" check box. Then you will see the following window.


9. Click "Remove Features".
10. Then you will see the following window and then click "Demote this domain controller".

11. On "Credentials" screen, check "Last domain controller in the domain".


Because there is 1 domain controller in my environment, I need to check "Last domain controller in the domain". If there is more than 1 domain controller in your environment, you don't need to check this option.

Remark: On Windows Server 2012, "Force the removal of this domain controller" is instead of "dcpromo /forecremoval".

12. Click "Next".
13. On "Warnings" screen, check "Proceed with removal".


14. Click "Next".
15. On "Removal Options" screen, check "Remove the DNS zone (this is the last DNS server that hosts the zone)", "Remove application partitions".


Remark: If your environment is more than 1 domain controller, you don't need to check the above options, ("Remove the DNS zone (this is the last DNS server that hosts the zone)" and "Remove application partitions").

16. Click "Next".
17. On "New Administrator Password" screen, provide a new password for the local administrator.


18. Click "Next".
19. On "Review Options" screen, click "Demote".


20. When the demotion finished, the server will restart automatically.


As a result, the domain controller has been demoted.

This posting is provided “AS IS” with no warranties, and confers no rights!

Sunday, September 23, 2012

Converting Windows Server 2012 Server Core interface to GUI interface

To convert Windows Server 2012 Server Core interface to GUI interface, perform the following steps.

Prerequisites
A fresh installation of  Windows Server 2012 with Server Core interface

1. On a Windows Server 2012 server, log in as Administrator.
2. Insert "Windows Server 2012 DVD" into the server.

Assuming D drive is the DVD drive of the server.

3. Perform "PowerShell" in a "Command Prompt".


We need to mount the Windows Server 2012 image on a folder before installing the Windows features because the roles or features of Windows Server 2012 are not install in Windows Server 2012 Server Core environment. If there is no Internet access for the server, mounting the Windows Server 2012 image can provide the source for installing Windows feature.

4. Perform "Get-WindowsImage -ImagePath "D:\sources\Install.wim".


In my test environment, I need to mount "Windows Server 2012 SERVERDATACENTER", index 4 , on a folder.

5. Perform "New-Item C:\WinSources -Type Directory" to create a new folder.


6. Perform "Mount-WindowsImage -ImagePath D:\sources\Install.wim -Index 4 -Path C:\WinSources -ReadOnly".


7. Perform "Install-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell -Sources C:\WinSources\Windows\WinSxS".


8. Perform "Restart-Computer" to restart the server.
9. After restarted, log in as Administrator.


As a result, the server has been changed to GUI interface.

This posting is provided “AS IS” with no warranties, and confers no rights!

Saturday, September 22, 2012

Converting Windows Server 2012 GUI interface to Server Core interface

In Windows Server 2012, it is easy for us to covert the interface between GUI and Server Core.

To convert Windows Server 2012 GUI interface to Server Core interface, perform the following steps.

Prerequisites
A server is installed Windows Server 2012 with GUI interface

1. On a Windows Server 2012 server, log in as Administrator.
2. Launch "Server Manager".
3. Click "Manage > Remove Roles and Features".


4. On "Before you Begin" window, click "Next".
5. On "Server Selection" window, select "Select a Server from the server pool > <Server Name>".


6. Click "Next" twice.
7. On "Features" window, clear "User Interface and Infrastructure".
8. On "Remove Roles and Features Wizard", click "Remove Features".


9. Make sure "Graphical Management Tools and Infrastructure" and "Server Graphical Shell" were cleared.


10. Click "Next".
11. On "Confirmation" window, check "Restart the destination server automatically if required".


12. On "Remove Roles and Features Wizard", click "Yes".


13. Click "Remove".

The server will restart automatically.

14. After restarted, log in as Administrator.


As a result, the server has been changed to Server Core interface.

This posting is provided “AS IS” with no warranties, and confers no rights!

Wednesday, September 19, 2012

Installing Windows Server 2012 with GUI

To install Windows Server 2012, make sure the server meet the minimum system requirement.

  • 1.4 Ghz 64-bit processor
  • 512 MB RAM
  • 32 GB disk space
  • DVD drive
  • Super VGA (800 x 600) or higher-resolution monitor
  • Keyboard and Microsoft mouse (or other compatible pointing device)
Reference:
Installing Windows Server 2012

Prerequisites
Windows Server 2012 installation DVD

1. Power in the server and insert the Windows Server 2012 installation DVD.


2. On setup screen, you can select the "Language", "Time and currency format" and "Keyboard or input method".
3. In my environment, I don't need to modify it. Click "Next".


4. Click "Install now".


5. Provide the product key for Windows Server 2012, click "Next".


6. On "Select the operating system you want to install", select "Windows Server 2012 Datacenter (Server with a GUI)".


7. Click "Next".
8. Read the "License terms", check "I accept the license terms".


9. Click "Next".
10. On "Which type of installation do you want", select "Custom: Install Windows only (advanced)".


11. On "Where do you want to install Windows", select the "Hard disk".


Remark: If there is more than 1 hard disk in the server, you have to select the hard disk which is the first boot priority.

12. Click "Next".


Now, the Windows Server 2012 is installing in the server.

13. Provide a password of Administrator on this server.


14. Click "Finish".


As a result, the installation of Windows Server 2012 was finished. You can log in as Administrator on the server.

This posting is provided “AS IS” with no warranties, and confers no rights!

Sunday, September 9, 2012

Event ID 4013 DNS-Server-Service on a P2V domain controller

Last week, I needed to perform P2V on one of domain controllers from production environment to test environment. The test environment is in an isolate network. All servers in test network cannot connect to the servers are in production environment. After the domain controllers converted to the VM format in test environment, I tried to start-up and log in the domain controllers. However, if the VMs is added the network adapter, I can't use one of the domain administrator accounts to log in. Then I logged in the domain controller at DSRM (Directory Service Restore Mode). I found the following error.

The DNS server is waiting for Active Directory Domain Services (AD DS) to signal that the initial synchronization of the directory has been completed. The DNS server service cannot start until the initial synchronization is completed because critical DNS data might not ey be replicated onto this domain controller. If events in the AD DS event log indicate that there is a problem with DNS name resolution, consider adding the IP address of another DNS sever for this domain to the DNS server list in the Internet Protocol properties of this computer. This event will be logged every two minutes until AD DS has signaled that the initial synchronization has successfully completed.


Because the domain controller is in isolate network. It can't contact the other domain controllers to perform initial synchronization. If the initial synchronization does not perform, the DNS service startup is delayed.

To solved this case, I followed the steps which are provided by KB 2001093.

Prerequisites

  • Remove all network adapters on the VM, domain controller.

1. At the domain controller, log in as Administrator at DSRM.
2. Launch "Registry Editor".
3. Expand "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters".
4. Right-click "Parameters", select "New > DWORD (32-bit) Value".
5. Enter "Repl Perform Initial Synchronization".


This domain controller will bypass initial synchronization. I can add the network adapter for this domain controller and boot up on normal mode.

As a result, I can log in as Domain Administrator in test lab.

Reference:
Troubleshooting DNS Event ID 4013: The DNS server was unable to load AD integrated DNS zones
http://support.microsoft.com/kb/2001093

This posting is provided “AS IS” with no warranties, and confers no rights!

Configuring iSCSI target on Windows Server 2012

In previous Windows versions, the iSCSI target isn't built-in in Windows Servers. To configure iSCSI target, you need to download and install the  on Windows, Windows Server 2008 R2 or using Windows Storage Server.

In Windows Server 2012, the iSCSI target is a feature of Windows Server 2012 and it is easy for us to install and configure.

Goal
Configuring the iSCSI target on Windows Server 2012 GUI.

Lab environment
  • 2 Windows Server 2012 servers named MS01 and MS02
  • The IP addresses of these servers are 192.168.1.10 and 192.168.1.20
  • MS02 will be installed and configure the iSCSI target

Lab
1. On MS02, log in as Administrator.
2. Launch Server Manager, click "Add roles and features".
3. At "Before You  Begin" window, click "Next".
4. At "Installation Type", select "Role-based or feature-based installation".


5. Click "Next".
6. At "Server Selection", click "Next".
7. At "Server Roles", expand "File And Storage Services > File and iSCSI Services".
8. Check "iSCSI Target Server".


9. Click "Next" twice.
10. At "Confirmation", click "Install".


11. When installation finished, click "Close". 
12. At "Server Manager", click "File and Storage Services".


13. Click "iSCSI".


14. Click "To create an iSCSI virtual disk, start the New iSCSI Virtual Disk Wizard".


15. At "iSCSI Virtual Disk Location", you can select a volume or a custom path to store the VHD.


16. I select volume C: to store the VHD, click "Next".
17. Next to "Name", type "MS01_HD01".


18. Click "Next".
19. Next to "Size", type "10"GB.



20. Click "Next".
21. Select "New iSCSI target".


22. Click "Next".
23. Next to "Name", type "ForMS01".


24. Click "Next".
25. At "Access Servers", click "Add".
26. Select "Enter a value for the selected type" and then select "IP Address".
27. Next to "Value", type "192.168.1.10".


28. Click "OK".



29. Click "Next".
30. At "Enable authentication", leave the default settings, click "Next".
31. At "Confirmation", click "Create".
32. As a result, the virtual disk and iSCSI target have been configured.


33. Click "Close".


Test result
1. On MS01, log in as Administrator.
2. Launch "Server Manager".
3. Click "Tools > iSCSI Initiator".


4. Click "Yes" to start the "iSCSI service".
5. Select "Discovery" tab.


6. Click "Discover Portal".
7. Under "IP address or DNS name", type "192.168.1.20".


8. Click "OK".


9. Select "Targets" tab.


10. Click "Connect".



11. Leave default settings, click "OK".
12. Click "OK" to close "iSCSI Initiator Properties".
13. Back to "Server Manager".
14. Click "File and Storage Services".
15. Click "Disks".


You can see the iSCSI disk has been connected. Now, I can configure the iSCSI disk.

This posting is provided “AS IS” with no warranties, and confers no rights!