How to: Initialize, format and label disks during OSD Task Sequence in SCCM 2012 R2

During a task seuence in Microsoft SCCM 2012 R2, the operating system and applications are installed on the C: drive in most situations. But in some deployments, you definitely want to create more disks. For example, you want to create a D: and E: partition for storing some other data. Maybe for Microsoft SQL or Exchange installation, databases, logfiles or just some other data.

The following script will do all these steps for you during the task sequence. The script initialize, format, partition and label the disks for you….fully automated! 🙂

## Set CD-ROM from E: to X:
Set-WmiInstance -InputObject ( Get-WmiObject -Class Win32_volume -Filter "DriveLetter = 'E:'" ) -Arguments @{DriveLetter='X:'}

$disks = Get-Disk | measure
If($disks.Count -eq 2)
{
## Initialize all new disks
Initialize-Disk 1
## Format and rename disks
Get-Disk | where {$_.Number -eq "1"} | New-Partition -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel Data -Confirm:$false
## Set drive letters (D: - Data, E: - Backup)
Get-Disk | where {$_.Number -eq "1"} | Get-Partition | where {$_.PartitionNumber -eq 2} | Set-Partition -NewDriveLetter D
}
elseif($disks.Count -eq 3)
{
## Initialize all new disks
Initialize-Disk 1
Initialize-Disk 2
## Format and rename disks
Get-Disk | where {$_.Number -eq "1"} | New-Partition -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel Data -Confirm:$false
Get-Disk | where {$_.Number -eq "2"} | New-Partition -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel Backup -Confirm:$false
## Set drive letters (D: - Data, E: - Backup)
Get-Disk | where {$_.Number -eq "1"} | Get-Partition | where {$_.PartitionNumber -eq 2} | Set-Partition -NewDriveLetter D
Get-Disk | where {$_.Number -eq "2"} | Get-Partition | where {$_.PartitionNumber -eq 2} | Set-Partition -NewDriveLetter E
}
else
{
exit
}
exit

The script first checks how many disks are attached to the server.
If there is only one disk attached, you’ll have only a C: drive available after the deployment.
If there are 2 disks attached, you’ll have a C: and D: drive avalailable after the deployment.
If there are 3 disks attached, you’ll have a C:, D: and E: drive available after the deployment.

The CD-ROM drive will alse changed from E: to X:.

2015-12-18_12h30_44    2015-12-18_12h32_27    2015-12-18_12h32_52

2015-12-18_12h34_31    2015-12-18_12h37_51    2015-12-18_12h41_05

2015-12-18_12h41_43

WEBINAR: Scripting & Automation in Hyper-V without SCVMM

Webinar_Altaro

Save the date!!

the 10th of december there is a free webinar about automating tasks in your Hyper-V environment without the user of Microsoft System Center Virtual Machine Manager (SCVMM).

This is realy usefull for that customers who don’t have System Center within their environment! Automation and scripting some tasks can save you a lot of time and money!
MVP Thomas Maurer and Technical Evangelist Andrew Syrewicze will present this webinar!

webinar-Join-button-scripting-automation1

First look at Windows Server 2016 Technical Preview 2 Build 10074

Microsoft has released a new version of Microsoft Server 2016 Technical Preview 2, so I’ve installed this version immediately within my Hyper-V environment. After starting the setup, you’ll see there’re two versions:

  • Windows Server Technical Preview 2
  • Windows Server Technical Preview 2 (with local admin tools)

The difference between theese two versions is the User Experience. In previous version of Windows, it was called Windows Server Core Edition. So the version without the local admin tools, the user has no option to enable/install the graphical user interface (GUI).

2015-05-05_13h20_59    2015-05-05_13h21_04    2015-05-05_13h21_45

2015-05-05_13h22_00    2015-05-05_13h22_05    2015-05-05_13h23_21

2015-05-05_13h27_33    2015-05-05_13h27_38    2015-05-05_13h28_09

2015-05-05_13h28_14    2015-05-05_13h30_26    2015-05-05_13h30_29

2015-05-05_13h30_44

After the installation, you’ll see that there’s a difference between the User Experience. One version, the Server Manager is available and the other version has only a command prompt available. You’ve to manage this server from another server with the Remote Server Administrative Tools (RSAT). The version with the admin tools included, there’s a possibility to enable the Graphical User Interface (GUI).

2015-05-05_13h30_56    2015-05-05_13h31_04    2015-05-05_13h32_11

2015-05-05_13h33_56    2015-05-05_13h34_09    2015-05-05_13h34_18

2015-05-05_13h37_05    2015-05-05_13h38_29    2015-05-05_13h38_38

2015-05-05_13h53_34    2015-05-05_13h53_53    2015-05-05_13h55_13

2015-05-05_13h56_10

After a reboot, the server is turned on with a Graphical User Interface (GUI) and it looks pretty cool!! And YESSSS, the start menu is back again 🙂 What a great time for some users!! With this new version of Windows Server, there’s is a complete new “world of bits and bytes”….

Free Ebook: Microsoft System Center Deploying Hyper-V with Software-Defined Storage & Networking

Microsoft has released a great free Ebook of how to Deploy Hyper-V with Software-Defined Storage & Networking (SDN). In this Ebook you’ll learn all the basics of Software Defined Datacenter and how to use it in real life!

You can download this Ebook here: Microsoft System Center Deploying Hyper-V with Software-Defined Storage & Networking

deploy-hyperv-with-sdn-ebook (2)

 

How to: Deploy packages using collection variable with ConfigMgr 2012 R2

During a OS deployment you don’t want to deploy all your packages and software to every workstation. You can deploy the software after a full OS deployment, but you can also deploy packages during the OSD using collection variables. Now it is possible to deploy packages only if a specific machine is a member of a collection. This collection can be query based, for example OU membership or Active Directory security group, or it can be static (direct membership).

In this example I’ve created a realy simple deployment, Adobe Reader 11.0. I’ve two virtual machines, SCWIN81-01 and SCWIN81-02. Both machines are members of the collection “Deploy – Windows 8.1 Enterprise x64”, where the task sequence is deployed on. Machine SCWIN81-01 is also member of the collection “Install – Adobe Reader 11.0”. This collection has a limited collection of “Deploy – Windows 8.1 Enterprise x64”. Both machines are deployed on the same time, the only difference is that machine SCWIN81-01 has Adobe Reader 11.0 installed and machine SCWIN81-02 not. Why……based on the collection variable during the OSD 🙂

1.) First create the collections
2.) Make the specific machines members of the right collections (query based or direct membership)
3.) Open the properties of the collection “Install – Adobe Reader 11.0” and navigate to the “Collection Variables” tab
4.) Add one or more variables with some values. In this example the variable is “APP-AdobeReader” with the value “Yes”
5.) Open the task sequence and add a package installation step
6.) Add the package with the program and navigate to the “Options” tab
7.) Select “Add Condition” and select “Task Sequence Variable”
8.) Enter the collection variable you’ve created earlier with the same value. In my example:
Task Sequences Variable APP-AdobeReader equals “Yes”
9.) Select “Apply” and close the task sequence.
10.) Start the OSD on both machines and wait until the installation is done!
11.) Watch the differences between both machines, if everything is okay, one machine has Adobe Reader installed and the other not.

This is an extremely powerfull thing within ConfigMgr, and really helpfull is some scenario’s. For example VDI golden image deployments or hybrid environments with laptops/desktops or multiple organizations using one ConfigMgr environment. One main reason could be consolidation in task sequences. If you want, there should be only one task sequence for all you different deployments. This is why I’m loving collection varaibles! 🙂

2014-12-22_15h45_33    2014-12-22_15h46_26    2014-12-22_15h46_48

2014-12-22_15h47_23    2014-12-22_15h49_46    2014-12-22_15h50_15

2014-12-22_15h50_37    2014-12-22_15h51_16    2014-12-22_15h51_58

Enabling Data Deduplication in Windows 8.1

When you do a lot of deployments whitin your Windows 8.1 Client Hyper-V machine, the disk space is getting more and more. Because I’ve only one SSD drive of 250 GB, the free space becomes critical. I’ve got to find a way to reduce it. I read a few blogs and found a solution which is the dedup. But data deduplication is not available whitin Windows 8.1.

This method is not officially supported by Microsoft ,however found a way to save my disk space.

This method requires the CAB files from the Windows Server 2012 R2.  Either you can get those files from a Windows Server 2012 R2 or you can download the files from my OneDrive here.
The files are as follow :
• Microsoft-Windows-Dedup-Package~31bf3856ad364e35~amd64~en-US~6.3.9600.16384.cab
• Microsoft-Windows-Dedup-Package~31bf3856ad364e35~amd64~~6.3.9600.16384.cab
• Microsoft-Windows-FileServer-Package~31bf3856ad364e35~amd64~en-US~6.3.9600.16384.cab
• Microsoft-Windows-FileServer-Package~31bf3856ad364e35~amd64~~6.3.9600.16384.cab
• Microsoft-Windows-VdsInterop-Package~31bf3856ad364e35~amd64~en-US~6.3.9600.16384.cab
• Microsoft-Windows-VdsInterop-Package~31bf3856ad364e35~amd64~~6.3.9600.16384.cab

I downloaded the files to a folder as below and installed all the CAB files:

DataDedup_02    DataDedup_01

Next step is to install the CAD files on your Windows 8.1 machine. I’ve used DISM to install these files.

DataDedup_03    DataDedup_04

After you’ve succesfully installed the CAB files, you’re able to install the “Data Deduplication” role. I’ve also used DISM (see screenshot below).

DataDedup_05    DataDedup_06    DataDedup_07

The next step is to enable Data Deduplication on the volume or volumes. First I’ve readthe current free space on my E: drive. After enabling Data Deduplication on this volume, I’ve manually started the Data Dedup task.

DataDedup_08    DataDedup_09    DataDedup_10

DataDedup_11    DataDedup_12    DataDedup_13

DataDedup_14

But after enabling Data Depuplication and running the Dedup Job, there’s nothing happening!! Why?? Because the minimumFileAgeDays is 3 and my files on the hard drives are 2 days old 🙂 So I’ve added the MinimumFileAgeDays to 0 (zero days). After running the Dedup Job again, let’s have a look on the current free space!! Dedup is doing his job!!! 🙂 Cool!

DataDedup_15    DataDedup_16    DataDedup_17

DataDedup_18    DataDedup_19    DataDedup_20

DataDedup_21    DataDedup_22

The final screenshot are the commands I’ve used to configure this in my lab environment. Once again, this method is not officially supported by Microsoft.It’s a great way to save some disk space on your expensive SSD hard drive! Now you can deploy more virtual machines on the same hard drive, so happy automation and deployment!! 🙂

Register now for the Veeam Live Show!!

It’s not the first time for Veeam to throw an online show, but this time we have some very special hosts and guests: Ian Wells, Veeam Regional Director, Northern Europe, Aseem Anwar, Veeam Senior Systems Engineer, UK & Ireland, and Barry Coombs, ComputerWorld Pre Sales and Technical Architect Manager. Learn about the role of technologies in business and what we are up to in the next 5 years, plus:

  • Catch up on and debate IT trends, with a focus on datacenter technologies
  • Find out industry insights and the most important considerations
  • Get answers to questions that matter to you!

This will be an open discussion with NO script or boring slide deck! The show starts on: Sept. 18, 15:00 BST, 16:00 CEST

Don’t miss it! Register now and you’ll get an invitation to the next episode covering Veeam and SCOM for Hyper-v.

Build your own FREE virtualization lab environment

2014-06-27_12h36_26

The most affordable toolkit to meet your goals!

There is no better way to start virtualizing than with a FREE Microsoft Hyper-V environment, free backup, free virtual storage and free management software!

With this free toolkit, you can create your own test lab, run a small business or even scale your production environment up to 1,000 VMs. It’s a FREE way to virtualize!

  1. Microsoft Hyper-V Server 2012 R2
    Free Hypervisor with all the functionality of it’s ‘big brother’, Windows Server 2012 R2 Hyper-V
  2. Veeam Backup & Replication
    Effective and easy-to-use tool for Hyper-V backup
  3. StarWind Virtual SAN
    Reliable shared storage with unlimited storage capacity for a single-node device
  4. 5nine Manager
    Simple and easy-to-use Graphical User Interface, local or remote, to manage Hyper-V virtual machines

Start today!!

And if you would like to just download Free Microsoft Hyper-V Server 2012 R2, please click here.

2014-06-27_12h36_43