Tuesday, September 15, 2015

Installing Active Directory on Windows Server 2012

Description

This article will walk you through setting up the Active Directory Role on a Windows Server 2012. This article is intended to be used for those without an existing Active Directory Forest, it will not cover configuring a server to act as a Domain Controller for an existing Active Directory Forest. 

Content

Installing Active Directory

1. Open the Server Manager from the task bar. 
2. From Server Manager Dashboard select Add roles and features. This will launch the Roles and Features Wizard allowing for modifications to be performed on the Windows Server 2012 instance.
3. Select Role-based or features-based installation from the Installation Type screen and click Next
Note: Roles are the major feature sets of the server, such as IIS, and features provide additional functionality for a given role.
4. The current server is selected by default. Click Next to proceed to the Server Roles tab.
5. From the Server Roles page place a check mark in the box next to Active Directory Domain Services. A notice will appear explaining additional roles services or features are also required to install domain services, click Add Features.
Note: There are other options including, Certificate services, federation services, lightweight directory services and rights management. Domain Services is the glue that holds this all together and needs to be installed prior to these other services.
6. Review and select optional features to install during the AD DS installation by placing a check in the box next to any desired features; Once done click Next.
7. Review the information on the AD DS tab and click Next.
8. Review the installation and click Install.
Note: The installation progress will be displayed on the screen. Once installed the AD DS role will be displayed on the 'Server Manager' landing page.

Configuring Active Directory

Once the AD DS role is installed the server will need to be configured for your domain.
1. If you have not done so already, Open the Server Manager from the task bar. 
2. Open the Notifications Pane by selecting the Notifications icon from the top of the Server Manager. From the notification regarding configuring AD DS click Promote this server to a domain controller.
3. From the Deployment Configuration tab select Add a new forest from the radial options menu. Insert your root domain name into the Root domain name field.
 
4. Review and select a Domain and Forest functional level. Once selected fill in a DSRM password in the provided password fields. The DSRM password is used when booting the Domain Controller into recovery mode.
Note: The selection made here will have lasting effects to features and server domain controller eligibility. For further information on Domain/Forest functional levels see official Microsoft documentation.
5. Review the warning on the DNS Options tab and select Next.
6. Confirm or enter a NetBIOS name and click Next.
7. Configure the location of the SYSVOL, Log files, and Database folders and click Next.
8. Review the configuration options and click Next.
9. The system will check to ensure all necessary prerequistes are installed on the system prior to moving forward. If the system passes these checks you will proceed by clicking Install.
Note: The server will automatically be rebooted once the installation completes.
10. Once the server is done rebooting reconnect via RDP. Congratulations on successfully installing and configuring a Active Directory Domain Services on Windows Server 2012.

How to resize Windows Server drives in VMware

The ability to add virtual devices is awesome. Now sometimes, there’s some hard lessons to learn if someone jumps in without slowing down to think about certain things, like the guidelines defined up front.
One of the most common things that a system administrator will have to do in a virtualized environment is give out more RAM, CPU or disk space to a virtual machine. The whole point of virtualization is having the ability to dynamically change these values, but some can need more than a simple reboot, especially when it comes to resizing disks.
I’m going to go through the process of increasing the disk space of a virtual machine running Microsoft Windows Server 2012 running on VMware 5.1 (vSphere 5.1, ESXi 5.1 host and VMware tools installed). Along the way, I’m going to discuss a potential issue that can cause a lot of headaches, but ones that can be avoided with pre-defined guidelines or best practices.

A simple example

Let’s start with the simplest example where I have created a Windows Server 2012 VM with a single OS drive of 40 GB. You’ll see the Disk Management snapin will show below. Nothing much to see here except one single volume.
disk management snapin
Here’s what the settings look like for this VM in VMware. We have one single hard disk. The fact that it’s configured as “lazy zeroed” is not important, and what I go through here applies to the other two types of disks you’ll find (“thin” and “eager zeroed”). Just remember that you won’t be able to resize the disk if it has a snapshot.
VM settings
Let’s start off by increasing the size of this disk to 45 GB. You simply need to change the value in the above VM properties to the desired value and click OK. Pretty simple so far. We’ve increased the size of the underlying disk, but need to do a few things in the operating system now.
The first thing we’re going to do is to get the operating system to do a disk rescan, which is really simple to do via the Disk Management console, by simply selecting Rescan Disks.
Rescan disks
From here, we’ll see an extra amount of disk space show up in the console as “Unallocated.” We have the choice of what we want to do with this unallocated space, but in this example, we want to use this space to increase the current size of the operating system drive.
Disk space - operating system drive
This shows one of the awesome improvements in Windows Server. In Windows Server 2003, resizing the OS drive wasn’t possible, but this changed in Windows Server 2008.
So now that we have our “extra space,” resizing the OS drive is another simple task. Just by right-clicking on the partition, we have an “Extend Volume” option. This will fire up a pretty simple wizard (not shown). For example, you can choose whether you want to use the full size of the unallocated space.
Resizing the OS drive
After the wizard finishes, your disk is now resized as you requested. This is all done while the operating system is running, too! This is the magic that virtualization provides. Think about how much effort it would take to do something like this on a physical server.
System specs

Bad setup for future increases

Now, let’s say we have a setup with two volumes on one single disk. What happens if we need to increase the space of a volume? Does it matter which volume?
Based on the previous example, we just need to resize the disk in VMware, and then extend the volume, right? Here’s where we might have a problem.
This is what our disk looks like when we have two volumes on the same disk. The important thing to note is that C: is not the last volume on the disk, while E: is at the end.
Increase volume space 1
If we go through the same kind of process as before (not show again here), we increase the size of the single disk and do a rescan, the result would look something like this:
Increase volume space 2
So, if the goal was to increase the size of the C: drive then by simply right-clicking on the drive, it could be extended as before. Hold on–there’s a problem, because when the drive is right-clicked on, the “Extend Volume” option is disabled. Remember that the C: drive is not at the end of the drive.
Increase volume space 3
OK, will I see the same behavior if I tried to extend the E: drive instead, right? Remember that this volume is at the end of the drive. Now I have the “Extend Volume” option available and can use it.
Increase volume space 4

Lesson learned

The important takeaway from the previous example is if you are trying to resize a volume, then it either has to be the only volume on the disk or must be at the end of the disk. The problem is that a volume can’t be moved by the built-in features.

Guideline: One volume per disk

I want to show you how easy it is to resize a disk, but also to offer a practical example to show how important it is to plan and design virtual machines properly at setup.
A best practice or guideline in a virtualized environment is to look at having a “one volume per disk” policy or guideline. It can save you a lot of trouble in the future, especially in a virtualized environment, where all of a sudden you need to increase the size of a volume.
In the original example above, we had a single volume on a single disk, and then we moved on to two volumes on a single disk.
The better way to setup two volumes on a virtual machine would be to have two disks, so that each volume had its own dedicated disk.

Setting up a second disk

In this next example, if I started off with a system with a single disk, and wanted to add a second disk it would be as simple as adding the proper virtual hardware to the virtual machine as shown below.
Setting up a second disk 1
I’ve skipped a few steps between having a single disk/volume to having the setup below where I have my C: and E: volumes on different drives. Once you add a new disk to an existing Windows Server virtual machine you have to bring the disk online, initialize it and create a volume on it (not shown).
This is what a better setup looks like:
Setting up a second disk 2
In this last example, I don’t have any constraints if I need to increase the size of either my C: or E: drives because now they are either the only volume on the disk or are at the end.

Tuesday, August 18, 2015

How to check your SID using PsGetSid

As more and more people using virtualization, they face the problems like having two same SIDs on the network. NewSid is officially not supported by Microsoft anymore, so your virtual machine who’s SID was changed with NewSid is not supported anymore. Microsoft recommends using sysprep as a method to change SID on your operating system. I’ll show you how to use it in my next post, but today I’ll show you how easy is to check your SID, using free tool from Sysinternals called PsGetSid.
First you have to download PsGetSid from PsGetSid download page. Then extract it from the archive PsTools (for example on your desktop). You’ll see PsGetSid among the other PsTools.
PsTools_folder
Using Command Prompt navigate to that folder, and use simple command:
psgetsid COMPUTERNAME
where COMPUTERNAME is the name of your computer.
PsGetSidIn my case I used psgetsid WS2008R2-3.

Usage:

Also, there are other possibilities, and usage is as follows:
Usage: psgetsid [\\computer[,computer[,...] | @file] [-u username [-p password]]] [account|SID]
PsGetSid works for sure on Windows Server 2008 R2 , but it should work also on Windows XP, Windows Server 2003, Windows Vista, Windows 7

How to change SID on Windows 7 and Windows Server 2008 R2 using sysprep


How to change SID on Windows Server 2008 R2 and Windows 7 using sysprep.

I see many of you are looking how to change SID using NewSID, but New SID is not officially supported by Microsoft. You could use NewSID on Windows Server 2008, but when you try to use it on Windows Server 2008 R2 it won’t work, actually, it will “destroy” operating system. I didn’t test it on Windows 7, but still my advice is to use sysprep. Changing SID using sysprep is also very simple, just follow few steps as described below…
I tested sysprep on Windows Server 2008 R2 Datacenter edition, but same steps apply for Windows7 also.
First, click to Start->Run, type sysprep and press OK.
sysprep1

This will open sysprep folder which is located in c:\Windows\System32. Open sysprep application.
sysprep2

This will open System Preparation Tool 3.14 window. As a System Cleanup Action select Enter System Out-of-Box Experience (OOBE)Important: select Generalize if you want to change SID, it’s not selected by default. As Shutdown Options selectReboot.
sysprep3

It will take some time for sysprep to finish, so grab a cup of coffee and wait.
sysprep4

After rebooting you’ll have to enter some data, for example, Country or region, Time and currency and Keyboard input.
sysprep5

Also, you’ll have to accept EULA. And that’s it. After booting, in Server Manager you’ll see that everything is changed, if you had some settings set now they’re changed.
sysprep6

Now you can again use PsGetSid to check that your OS has new SID.

Wednesday, February 18, 2015

Configure Software RAID

Configure Software RAID 0

Step 1

Connect to PLABDM01 and minimize Server Manager Dashboard. Click on PowerShell icon on taskbar. You will prepare Disks 1, 2, and 3 for storage which will be used later.
RAID 0 is also called disk striping. This will not provide redundancy as RAID 1 and 5, but it will enhance disk throughput for read operations of files like databases.
To prepare Disk 1, type the following commands:
diskpart
list disk
select disk 1
online disk
attributes disk clear readonly
create partition primary size=10236
convert dynamic
Practice-Labs-Image
To prepare Disk 2, type the following:
list disk
select disk 2
online disk
attributes disk clear readonly
create partition primary size=10236
convert dynamic
Practice-Labs-Image
To prepare Disk 3, type the following:
list disk
select disk 3
online disk
attributes disk clear readonly
create partition primary size=10236
convert dynamic
Practice-Labs-Image
Minimize Windows PowerShell. Go to Administrative Tools and click on Computer Management. Right-click on Disk 1’s unallocated partition and choose New Striped Volume
Practice-Labs-Image
On Welcome to the New Striped Volume Wizard, click Next.
Practice-Labs-Image
On Select Disks page, in Available list box, click on Disk and Disk 3and choose Add.
From Select the amount of space in MB, type 500.
Click Next.
Practice-Labs-Image
On Assign Drive Letter or Path, click Next to accept the default.
Practice-Labs-Image
On Format Volume, click Next.
Practice-Labs-Image
Click Finish to close Completing the New Striped Volume Wizard.
Practice-Labs-Image

Configure RAID 1

RAID 1 also known as disk mirroring is useful for protecting operating system data as it creates an exact replica of the parent hard disk.

Step 1

From PLABDM01, go to Disk and right-click on (C:) and choose AddMirror
Practice-Labs-Image
On Add Mirror dialogue box, Disk is automatically selected for you. Click Add Mirror.
Practice-Labs-Image
Disk Management will prompt you that this operation will convert Diskto dynamic disk. Click Yes to continue.
Practice-Labs-Image
The creation of disk mirror volume will take a few moments, as data on drive C is synched with the selected replica disk.
Practice-Labs-Image

Configure RAID 5 Volume

RAID 5 volume is known as disk striping with parity. This type of disk volume requires at least 3 hard disks with unallocated partitions of the same size. It protects data written on a RAID 5 volume by creating parity bits which can be used by Windows to recreate lost data in the event one of the three disks in a RAID 5 volume fails.
RAID 5 can be used for protecting files like databases by providing fault tolerance.

Step 1

From PLABDM01, Go to Disk and right-click on the unallocated partition and choose New RAID-Volume
Practice-Labs-Image
Click Next on Welcome to the New RAID-5 Volume Wizard.
Practice-Labs-Image
On Select Disks page, under Available list box, select Disk and Disk 3and click Add.
In Select the amount of space in MB, type 700
Click Next.
Practice-Labs-Image
From Assign Drive Letter or Path, accept the default settings by clickingNext.
Practice-Labs-Image
On Format Volume page, choose Next.
Practice-Labs-Image
Select Finish to close Completing the New RAID-5 Volume Wizard.
Practice-Labs-Image

Creating Extended Volumes

Volume sets or extended volumes can be used for combining unallocated free space in found in different hard disks to create a bigger storage space.
An existing volume set can be expanded by including unallocated free space if a new hard disk was added to the system.

Step 1

From PLABDM01, go to Disk and right-click on the 10.00 GB RAWpartition and choose Extended Volume
Practice-Labs-Image
Select Next in Welcome to the Extended Volume Wizard page.
Practice-Labs-Image
On Select Disks page, under Available list box, select Disk and Disk 3and click Add. Choose Next.
Practice-Labs-Image
Click Finish to close Completing the Extend Volume Wizard screen.
Practice-Labs-Image
To prepare this extended volume to store data files, right-click on Disk1’s 10.00 GB RAW and choose Change Drive Letter or Path
Practice-Labs-Image
From Change Drive Letter and Paths dialogue, click Add
Practice-Labs-Image
Click OK in Accept the default drive letter indicated in Add Drive Letter or Path dialogue box.
Practice-Labs-Image
Finally, there is a prompt to format G to prepare it for data storage. Select Format disk.
Practice-Labs-Image
On Format Local Disk (G:) dialogue, click Start and choose OK to proceed with formatting.
Note: You will notice some time lag with formatting this extended volume as synchronisation of disk mirror is on-going.
Practice-Labs-Image
Click OK again when formatting is complete.
Practice-Labs-Image