Configuration Manager OSD - Ensure the OS always deploys to SSD drive if one is installed?

MAS2487 66 Reputation points
2021-05-05T15:18:52.887+00:00

We are deploying Windows 10 using Configuration Manager 2010.
Some PC's have a single drive, some have 2 drives.
Some will have an SSD and a regular HD. Some will 2 regular HD's.
I want to ensure that if a PC has an SSD drive, that the OS will always deploy to the SSD.
How best to accomplish this?
I was thinking of setting conditions in the task sequence like ...
If Disk 1 is SSD then install on Disk 1
If Disk 1 is NOT SSD then install on Disk 0

Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
897 questions
0 comments No comments
{count} votes

Accepted answer
  1. HanyunZhu-MSFT 1,841 Reputation points
    2021-05-12T09:48:46.52+00:00

    Hi, @MAS2487

    Just checking in to see if there is any update. We haven't heard from you for a few days and would like to know the current status of the problem. Is the problem solved?

    If the current version of your SCCM is 2006 or further, here's an another method that can meet your needs.
    Since version 2006, SCCM introduced "Variable name to store disk number", so in order to deploy the OS the to SSD, you can add a step " Run PowerShell Script" in task sequence to run the following scripts.

    #defalt value  
    $disk_idx = 0  
      
    #retrieve SSD  
    $ssd_disk = get-physicaldisk | where mediatype -like 'ssd'  
      
    #multiple SSD  
    if (@($ssd_disk).count -gt 1)  
    {  
     #multiple nvme SSD, choose the smallest one  
     if (@($ssd_disk | where bustype -like 'nvme').count -gt 1)  
     {  
     $disk_idx = $ssd_disk | Sort-Object -Property Size | Select-Object -ExpandProperty DeviceID -First 1   
     }  
     elseif (@($ssd_disk | where bustype -like 'nvme').count -eq 1)  
     {  
     $disk_idx = ($ssd_disk | where bustype -like 'nvme').deviceid  
     }  
    }  
    #singel SSD  
    elseif (@($ssd_disk).count -eq 1)  
    {  
     #multiple physical disks, choose SSD  
     if (@(get-physicaldisk).count -gt 1)  
     {  
     $disk_idx = ($ssd_disk).deviceid  
     }  
     #single pysical disks  
     else  
     {  
     $disk_idx = 0  
     }  
    }  
    #Write-Host "disk selected: $disk_idx"  
    (New-Object -COMObject Microsoft.SMS.TSEnvironment).Value('OSDDiskIndex') = $disk_idx  
    

    Below is the steps for your reference:

    1. Add a step Run PowerShell Script and choose Enter a PowerShell script, then enter the scripts.
      95972-ps.png
    2. In the step Format and Partition Disk, choose Variable name to store disk number, and enter the "OSDDiskIndex" in the box.
      95983-disk.png

    If you need further help, please don't hesitate to tell us. Look forward to hearing from you.

    Thanks for your time.


    If the response is helpful, please click "Accept Answer"and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. HanyunZhu-MSFT 1,841 Reputation points
    2021-05-06T10:14:10.163+00:00

    @MAS2487

    Thanks for posting in Microsoft Q&A forum.

    Since there is no PC with two SSD drivers in your environment, to deploy the OS to the SSD disk, you can create two Format and Partition steps.
    In the option tab of Partition Disk 1, add the conditions of WMI Query:
    *select * from WIn32_DiskDrive Where Index=1*
    *select * from WIn32_DiskDrive Where MediaType = 'SSD'*
    The OS will install in Disk 1 if Disk 1 is SSD. Otherwise the OS will install in Disk 0.
    94417-disk-1.png

    Hope the above information can help you.


    If the response is helpful, please click "Accept Answer"and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. MAS2487 66 Reputation points
    2021-05-17T14:06:45.78+00:00

    Hi Hanyun.

    The PowerShell script using the OSDDiskIndex variable worked great for my needs.
    Thank you so much!


  3. Franz Schenk 336 Reputation points
    2023-08-31T15:44:40.49+00:00

    The Script is useful, but not enough. Tha task sequence fails at the "Pre-Povision BitLocker" Step. The problem is that it's not possible to specify the disk number from a variable in this TS step. And the Disk ID delivered from the script is 0 for a system with one HD, and 1 for a system with two HDs.

    Any Advice how to configure the "Pre-provision BitLocker" Step?

    bl

    0 comments No comments

  4. Anonymous
    2023-12-24T15:59:18.1733333+00:00

    i have applied the script solution but although setup on the HDD not ssd

    0 comments No comments