Archive for category OS Deployment

Install Hyper-V Role to Windows Server 2012 R2 During OS Deployment

There are plenty of blogs about this subject, however, many of these blogs are outdated and some of their tips do not work properly for Windows Server 2012 R2. Also, in my case, I’m not using MSDT to install features and roles, but instead I’m using a captured WIM image.

To install Hyper-V role, just add a “Run Command Line” task, towards the end of the task sequence, Install Operating System task.

I’m using the following PowerShell command:

Powershell.exe -Command "& {&'Install-WindowsFeature' –Name Hyper-V -IncludeManagementTools -Restart}"

2016-10-28_1124

Also, here’s an interesting link that discusses this particular issue.

Leave a comment

SCCM 2012 R2 SP1 & PXE-E53 Error(s)

In SCCM 2012, you may encounter the following PXE error message:

PXE-E53: No  boot filename received
PXE-M0F: Exiting Intel Boot Agent
Selected boot device failed. Press any key to reboot….

IMG_1755

Unfortunately, there are many instances that will generate the error message above; one of those instances is when you’ve not set your Windows PE x86 to deploy in your distribution point.

Yes, even if you’re using Windows PE (x64), you must enable the (x86) version. (see below)

9-21-2015 12-03-34 PM

, , , , , , ,

Leave a comment

Deploy Windows Server 2008 R2 with SCCM 2012 and MDT 2013

In this article I’m going to show how to create a SCCM 2012 task sequence to deploy Windows Server 2008 R2 using Microsoft Deployment Toolkit 2013.

 
MDT 2013 has some features not found in SCCM 2012, such as installing Windows Server 2008 Roles and Features during a task sequence.
 
First, let’s get all the requirements out of the way.
Important: this document assumes that you have a working SCCM environment, and that you have a good background with SCCM 2012.
  1. Make sure to have an Operating System Images and an Operating System Installers ready for Windows Server 2008 R2 already installed in SCCM
  2. Download, install and configure Microsoft Deployment Toolkit 2013 (Make sure to perform these steps on the SCCM server!)
    1. Make sure MDT is properly installed

  3. Once you make sure that MDT is properly installed, then you need to create a MDT package in SCCM
    1. Basically, from the MDT installation folder, you’re going to copy the following folders to a network share that you’ll use to create the SCCM package: Control, Scripts, Servicing and Tools
    2. Once in the create package wizard, make sure you select This package contains source files and point it to the network share you created in step 2.1
    3. In the Program Type screen, select Do not create a program
    4. Once finished, make sure to Distribute Content
  4. Make sure these steps are done properly or you’ll have major issues with the rest of this how-to. I found some great information about creating an MDT package on this link
 
Create MDT Task Sequence for Windows Server 2008 R2
  1. Click on Create MDT Task Sequence
  2. In the Choose Template screen, select Server Task Sequence
  3. In the General screen, provide a name and description for the task sequence
  4. In the Details screen, provide the domain and domain account that will be used to join such domain. Also provide organization name and product key number for the installation of the server OS
  5. In Capture Settings screen, select This task sequence will never be used to capture an image
  6. In Boot Image screen, select your WinPE boot image, in my case that will be Boot image (x64)
  7. In MDT Package screen, you’re going to select the MDT package created earlier in this how-to (this portion will either make or break this how-to)
  8. In OS Image screen, select the Windows Server 2008 R2 WIM file (Described in requirements step 1)
  9. In OS Image Index, select the version of server you want to run, in my case it will be Sever 2008 R2 Enterprise
  10. In Client Package, select the SCCM client package that you’ve been using in your environment
  11. In Settings Package screen, in my case I selected just any package from the list…because I’m going to disable these tasks later on
  12. In Sysprep Package, there’s only one option already selected, so just hit Next button
  13. Hit Next until you get to Finish
Next, I’m going to Edit the previously created task sequence.
If you completed the requirements, you should not have any problems following these screenshots.
 
I deploy Windows Server 2008 R2 with only one partition, and that partition is labeled as Local Disk and uses drive letter C
Format & Partition Disk.png
Drive Letter Variable.png
Note: Grayed out steps are those that I do not use in my deployments. You’ll see that there are many steps grayed out by me, it’s up to you to disable them for your environment
Back in step 11, I asked you to pick any package from the list because I was going to disable it in the task sequence. Now, go through every single step in this task sequence and disable that package you selected for step 11. Again, this works for me and my environment.
There is one exception to this rule though, and you’ll see it soon!
In this step, we’re going to enable the Gather step found in the Install\Refresh Only section. Here’s the exception I mentioned earlier.
Gather

 

Also, pay close attention to the following fields in Apply Operating System Image section:

  • Destination – Logical drive letter stored in a variable
  • Variable name – System
    • System is used for drive letter, in this case C:

Apply Operating System

Next, we’re going to configure the Apply Windows Settings section.
Here, you’re going to type your company’s name and user name for this server, also you’ll need the server’s product key numbers.
In our environment, we have a licensing server, so I set the Licensing server field to Do not specify. Make sure you set the Time Zone as well.

Apply OS Settings

Now, we’re going to Apply Network Settings to our server installation.
This section will allows us to join this server to the domain. You can specify your domain name and the domain organizational unit (OU) where the server account can be placed.
The account used to join the server to the domain can be just a regular domain account.

Apply Network Settings
We’re now going to load drivers to our server installation, this is a nice to have option, but not required. Obviously, you have to have the driver packages created previously.

Apply Driver Package
Next, we’re going to load the SCCM client to our server installation. In this section, I’m loading the default SCCM client, which comes with SCCM installation, and I’m also installing a hotfix for the SCCM client.

 

Install SCCM Client

 
Now, we’re getting to the section where we’ll be adding server roles and features. As a matter of fact, this is the main reason why I decided to use MDT to deploy my Windows 2008 R2 servers.
Roles and FeaturesNote: It’s very important to make sure that Use Toolkit Package, Gather and Tattoo steps precede the Install Roles and Features section.
This section is pretty much self explanatory, just select the server roles and features you want to add then continue.

I have disabled some section (New Computer Only and Capture the Reference Machine) on purpose, you don’t have to to that.


See you all next time! 🙂
 
 
 
 
 
 
 
 
 

6 Comments

Use the asset tag on a DELL Latitude E6500 as the computer name

Background

So I ran into an interesting bug with our DELL Latitude E6500 models and Microsoft’s SCCM 2012.

First off, in our environment we use the BIOS service tag information on all our DELL devices as the computer name in Windows 7. I’m able to get this information during the Task Sequence (TS) by means of using a VB script.

The script I mention above works on all our DELL computer and laptop models, with the exception of the DELL Latitude E6500 laptop models.

The Bug

On a DELL Latitude E6500, with the BIOS updated to the latest version, it looks like the BIOS asset tag information is somewhat misleading. If you view the information, you’ll see the asset tag information, but what you don’t see are the trailing spaces after the asset tag information. For instance, if the BIOS asset tag information on a laptop reads X1234, there are 5 trailing spaces after it, and these white spaces do not show!

Note: We use a tool called asset.exe, from DELL, to modify the asset information and the owner information in the BIOS. This tool works well on many of DELL computers and laptops.

SCCM 2012 and The Bug

During a SCCM Task Sequence (TS) job, we collect the asset information and we use this information as the Windows 7 computer account. The TS works perfectly until the last step: Setup is applying system settings – at this point, the TS fails with the message: Windows could not parse or process the unattend answer file for pass [specialize]


The TS fails completely and you’re left with a computer whose OS isn’t working.

SCCM logs give a hint on what went wrong. In case you don’t know, those logs can be retrieved from the broken machine and the logs (setupact.log and setuperr.log) are located at: C:\Windows\Panther\UnattendGC
In our case, both files showed the following error message:

2013-02-27 15:35:17, Error     [Shell Unattend] ComputerName: failed to set the computer name [hr=0x80070057][gle=0x00000057]
2013-02-27 15:42:30, Error    [windeploy.exe] Setup.exe failed, returning exit code [0x1f]
2013-02-27 15:42:30, Error     [windeploy.exe] Failure occured during online installation.  Online installation cannot complete at this time.; hr = 0x80004005
2013-02-27 15:43:42, Error     [windeploy.exe] Setup.exe failed, returning exit code [0x1f]
2013-02-27 15:43:42, Error     [windeploy.exe] Failure occured during online installation.  Online installation cannot complete at this time.; hr = 0x80004005


After reviewing this log, this pointed me to the VB script mentioned earlier and to the BIOS asset tag information. I knew the script was working properly, so I turned my attention to the BIOS asset tag information.
After several hours of toying around with asset.exe, I realized that there were blank spaces after the asset tag information – 5 spaces in total!

The Workaround (not a fix)

Basically, I used asset.exe and deleted the current asset tag and re-typed it, but this time I added 5 letters to the end. In other words, my command line looked like this:

asset.exe X1234ABCDE

X1234 is the asset tag information (a.k.a my Windows 7 computer name); however, ABCDE is the workaround to make sure those blank spaces don’t break the TS.

After the TS finished, then I logged on as a local administrator and renamed the computer name to X1234 – life is good again!

Note: During this entire troubleshooting process we updated the laptop BIOS, and this didn’t seem to fix the issue.

I hope this helps someone out there.

Leave a comment

Enable Wake-On-LAN via CLI

The following will allow you to enable Wake-On-LAN for your network card interface. I’ve only test this on a Windows 7 system, and it’s been working properly in my environment.

By default, my systems have the following configuration:



After running the script, this is how it should look like:



Here’s the code, just copy the code and save with either a .BAT or .CMD extension.

@ECHO OFF
REM ********************************
REM ***** DESCRIPTION **************
REM ********************************
REM ***** Identify network card and write its name
REM ***** to file C:\Users\Default\AppData\Local\Temp\adapters.txt
REM ***** Name of network card is based on the following
REM ***** keywords: gigabit network connection ethernet
REM ********************************
REM ***** PARAMETERS BREAKDOWN *****
REM ********************************
REM ***** POWERCFG
REM ***** -devicequery Return a list of devices that meet the specified criteria
REM ***** wake_from_any Return all devices that support waking the system from any sleep state.
REM ********************************
REM ***** FINDSTR
REM ***** /I (or /i) Specifies that the search is not to be case-sensitive
REM ********************************
REM ***** Note: this is one long command line (word wrapping may show it as two lines)
POWERCFG -devicequery wake_from_any | FINDSTR /i "gigabit network connection ethernet" > C:\Users\Default\AppData\Local\Temp\adapters.txt

REM ********************************
REM ***** DESCRIPTION **************
REM ********************************
REM ***** Enable WoL on device with the following
rem ***** keywords in its name: gigabit network connection ethernet
REM ********************************
REM ***** PARAMETERS BREAKDOWN *****
REM ********************************
REM ***** POWERCFG
REM ***** -deviceenablewake Enable the device to wake the system from a sleep state
REM ********************************
FOR /F "tokens=*" %%i IN (C:\Users\Default\AppData\Local\Temp\adapters.txt) DO POWERCFG -deviceenablewake "%%i"

Leave a comment

SCCM 2012 – Software Center Options

The original information came from this source, I’m just adding a few more screenshots for my benefit.

The following script will allow you to change a particular setting found in SCCM 2012’s Software Center.

In Software Center, under the Options tab, and under the Computer maintenance heading, there is a setting – Automatically install or uninstall required software and restart the computer only outside of the specified business hours – that can be set to True (checked) or False (unchecked) by using this script.
2016-10-21_1506
Use the following code to obtain the current status of the option. This code you’ll use as the Discovery script.
$getStatus = Invoke-WmiMethod -Namespace "Root\ccm\ClientSDK" -Class CCM_ClientUXSettings -Name GetAutoInstallRequiredSoftwaretoNonBusinessHours -ComputerName $env:ComputerName -ErrorAction STOP

If ($getStatus.AutomaticallyInstallSoftware -eq "True")
{
Write-Host "Compliant"
}
Else
{
Write-Host "Non-Compliant"
}
Here’s how you’ll add this code to a Configuration Items object.
 discovery
Next, we’ll need to add the code to make the change or Remediation script
Invoke-WmiMethod -Namespace “Root\ccm\ClientSDK” -Class CCM_ClientUXSettings -Name SetAutoInstallRequiredSoftwaretoNonBusinessHours -ArgumentList @($TRUE) -ComputerName $env:ComputerName -ErrorAction STOP
Here’s how you’ll add this code to a Configuration Items object.
remediation
Next, we need to configure a Compliance Rule for the Configuration Item.
compliance
Now, as the final portion, we need to create a Configuration Baseline based on the Configuration Item created here and then deploy the Configuration Baseline.

2 Comments

OS Deployment – Computer Name from Asset Information

In a previous blog post, I modified a script to prompt to a computer’s name during a SCCM 2012 OS Deployment.

This new modified script basically takes the asset information (this isn’t the Asset Tag!) from our DELL computers and uses this information as the new computer name for the device being imaged.


Note: For DELL devices, you need to download DELL’s asset utility to assign an asset number/name to your devices. Sometimes this is automatically done by DELL when companies request it.
Link to updated script is here.


I’m going to over some of the more important details about this script.


Section 1



‘ Win32_SystemEnclosure is the class that contains the SMBIOSAssetTag property
‘ SMBIOSAssetTag property holds the Asset Tag information for the system
Set colSMBIOS = objWMIService.ExecQuery(“Select * from Win32_SystemEnclosure”,,48)


This is the WMI class (Win32_SystemEnclosure) that actually has the information that I’m looking for – the asset information.


Tip: Open a Command Prompt and type wmic then type SystemEnclosure. Now scroll to the right and you’ll see SMBIOSAssetTag column, and below it you should see the asset information assigned to this device. Again, although this labeled as SMBIOSAssetTag, it doesn’t make reference to DELL’s asset tag information, rather to the asset information that you assign using DELL’s utility.


Section 2



‘ Retrieve Asset Tag value from SMBIOSAssetTag
For Each ObjSMBIOS in colSMBIOS
sBiosAssetTag = ObjSMBIOS.SMBIOSAssetTag
Next


The information retrieved is a data collection, so we’re going to use a For..Next loop to retrieve only the data we need, in this case – SMBIOSAssetTag. This information is assigned to our variable sBIOSAssetTag


Section 3


If sBiosAssetTag = “” then
MsgBox “Asset tag has not been set!” & vbCr & “Go back and run DELL’s asset utility.” & vbCR & “Reboot to restart process…”, 0, “Missing Information”

‘ Clean up code to make sure that we log the error message
bExitCode = False
End If


I want to make sure that I, in fact, have assigned an asset information to this device. In the event that I’ve forgotten to run DELL’s asset utility, this section will notify me of such event.


Section 4

‘ We’re converting the name to all uppercase and assign it to OSDComputerName variable
oTaskSequence(“OSDComputerName”) = UCase(sBiosAssetTag)


In my case, I’m converting the value of of sBIOSAssetTag variable (which is a string) to all uppercase, then, this is assigned to our Configuration Manager/TS WMIC variable OSDComputerName.


That’s pretty much it.

Leave a comment