Thursday, October 2, 2014

Backup and Restore a WIM from WinPE using DISM

Backup an image
  1. Boot from WinPE media.
  2. Determine the drive letter to be captured.  This is typically C:,D:, or E:, but it can vary depending on which devices are connected to the system.
  3. There are a few choices for where to back up the image, but my preference is to back it up to a network drive.  To do this, run the following command: 
    • Net use Z: \\<ServerName>\<DestinationPath>\
    • You should see “The command completed successfully” if it works correctly.  Remember, you need to have write permissions to this directory in order to save the image to it, so you should be prompted for credentials to connect to the share.
  4. DISM.exe should already be in the path environment variable in WinPE 5.0, so you can call the DISM executable from pretty much anywhere.
    • DISM.exe /Capture-Image /ImageFile:Z:\capture.wim /CaptureDir:E:\
    • Where Z: is the path to which you want to save the image and E: is the path to the partition with Windows installed.
    • If the drive contains much data, it will take an amount of time proportional the amount of data and the throughput of your network, USB, or eSATA connection.  Be patient
Restore an image
To restore an image to a new machine or a new drive, it is a very similar process, only the command in step 4 really changes.
  1. Boot from WinPE media.
  2. Determine the drive letter to restore the image.  This is typically C:,D:, or E:, but it can vary depending on which devices are connected to the system.
  3. If you used a network path to backup your image, you must re-map the drive again.  To do this, run the following command.
    • Net use Z: \\<ServerName>\<DestinationPath>\
    • You should see “The command completed successfully” if it works correctly.  Remember, you need to have write permissions to this directory in order to save the image to it, so you should be prompted for credentials to connect to the share.
  4. DISM.exe should already be in the path environment variable in WinPE 5.0, so you can call the DISM executable from pretty much anywhere.
    • DISM.exe /Apply-Image /ImageFile:Z:\install.wim /Index:1 /ApplyDir:E:\
    • Where Z: is the path where the backup image is stored and E: is the path of the partition to restore the image.
    •  If the image contains much data, it will take an amount of time proportional the amount of data and the throughput of your network, USB, or eSATA connection.  Be patient!

Wednesday, October 1, 2014

Create a New AD and SCCM 2012 User Collection with PowerShell

Function New-SCCMUserCollection {
PARAM (
[Parameter(Mandatory = $true)] $ADCollectionName,
                [Parameter(Mandatory = $true)] $CMCollectionName,
$limitingCollection = "All Users",
# Customize the $path appropriately for your environment.
$path = "OU=Application Deployment,OU=Groups,DC=<YourDomain>,DC=<YourNamespace>",
$description = "Application Deployment Group",
# Customize your domain name in the query.
$queryExpression = "select SMS_R_USER.ResourceID,SMS_R_USER.ResourceType,SMS_R_USER.Name,SMS_R_USER.UniqueUserName,SMS_R_USER.WindowsNTDomain from SMS_R_User where SMS_R_User.SecurityGroupName = '<YourDomain>\\$($ADCollectionName)'",
$ServerName = "<YourServerName>",
$SiteCode = "<YourSiteCode"
)
# Get a reference object for grabbing the RefreshSchedule property
        # Use an existing collection as a template to replicate the RefreshSchedule.
$refreshSchedule = (Get-CMDeviceCollection -Name "7zip").RefreshSchedule[0]
$ruleName = $CMCollectionName

# Create AD Security Group
New-ADGroup -Name $ADCollectionName -SamAccountName $ADCollectionName -GroupCategory Security -GroupScope Universal -DisplayName $ADCollectionName -Path $path -Description $description -Verbose

# Create SCCM Collection
New-CMUserCollection -Name $CMCollectionName -LimitingCollectionName $limitingCollection -Verbose -RefreshSchedule $refreshSchedule -RefreshType 2

# Add collection rule
    $CollectionName = Get-CMUserCollection -Name $CMCollectionName
    Add-CMUserCollectionQueryMembershipRule -CollectionId $CollectionName.CollectionID -RuleName $ruleName -QueryExpression $queryExpression -Verbose
}

# Import the Configuration Manager 2012 Module
Import-Module "C:\Program Files (x86)\ConfigMgr2012\bin\ConfigurationManager.psd1"
# Set location the primary site code
Set-Location <YourSiteCode>:
Import-Module ActiveDirectory

# Edit this variable to reflect the desired AD Security Group Names
$ADCollectionName = "Test User Collection"

# Do not edit this variable unless it is a special circumstance.
$CMCollectionName = "$ADCollectionName - User"

# Usage: New-SCCMUserCollection -ADCollectionName $ADCollectionName -CMCollectionName $CMCollectionName

Tuesday, September 2, 2014

DaRT 2013 in SCCM 2012

Integrating DaRT from MDOP 2013 is a great way to troubleshoot and monitor operating system deployments remotely.  Deploymentresearch.com has a great article for how to configure this in your environment.
http://www.deploymentresearch.com/Research/tabid/62/EntryId/131/Adding-DaRT-8-1-from-MDOP-2013-R2-to-ConfigMgr-2012-R2.aspx

Friday, August 29, 2014

Generic CustomSettings.ini Files for SCCM, MDT integrated, Task Sequences

Generic CustomSettings.ini Files for SCCM, MDT integrated, Task Sequences

Example CustomSettings.ini files for SCCM, MDT integrated, task sequences can be found here.

Configure Dell BIOS from WinPE

Configure Dell BIOS from WinPE

To start off, I should clarify that I typically use SCCM Task Sequences with MDT integration.  The following scenario utilizes SCCM 2012 R2 with MDT 2013 integration.


  1. Download and install the Dell Client Configuration Toolkit (CCTK) from Dell's website: http://www.dell.com/support/home/us/en/04/Drivers/DriversDetails?driverId=6HCTN
  2. From the installation directory, typically C:\Program Files (x86)\Dell\CCTK, grab X86 and X86_64 folders and create an empty package (no programs).
  3. Additionally, add CCTK-default.cmd and show-cctkerrors.vbs to the root of your package folder, we'll be utilizing this in a task sequence step.  These files were originally authored by windowsmasher: http://windowsmasher.wordpress.com/2013/01/21/sccm-2012-generic-multi-platform-dell-cctk-bios-settings/.  Thank you!  I've made my own customization to the cmd file to better suite my needs.  Created a config subfolder in the CCTK package and drop Multi-Platform_Generic.ini there.  You can find the files you need here.  The final folder structure should look like this: 
    • root\X86\<all X86 files from CCTK>
    • root\X86_64\<all X86_64 files from CCTK>
    • root\config\Multi-Platform_Generic.ini
  4. Edit your OSD Task Sequence and insert a new folder Configure Dell BIOS.  I prefer to insert this at the Preinstall phase of the task sequence, although it technically can be applied anytime before the Apply Operating System image step in the task sequence.  This is because we reconfigure the SATA operating mode to the highest level that the BIOS is capable of, RAID On, AHCI, ATA, respectively.

  5. You must also remember to create evaluations in the options of this new folder to ensure that the PC is actually running in WinPE and that the Manufacturer is Dell.
  6. The next step is optional, but recommended for easily troubleshooting BIOS configuration issues.  Create a step called Connect to Network Drive.  This drive will be used for dumping log files in a subsequent step.
  7. After optionally mapping a network drive, it's time to perform the actual configuration.  It's recommended that you read through the cmd file and make appropriate modifications to best suite your environment.
  8. We must restart the computer to have the BIOS settings take effect.  This is particularly important for the SATA operation to ensure that the appropriate storage drivers are installed.  Make sure you reboot to WinPE, there is no operating system installed yet.
  9. After rebooting, we need to re-load the toolkit package and run the gather step again.