Hi,
We have several models, both HP and Lenovo with 2 disks (1 SSD and 1 SATA). At 
this moment I always want to install OS on the SDD drive so I wrote a simple 
script that checks disks and set a TS variable (TSOsdDisk) to use later in task 
sequence for format and apply the image:

$TSEnv = New-Object -ComObject Microsoft.SMS.TSEnvironment
$Disks = Get-PhysicalDisk
IF (($Disks).Count -ge '2')
{

  ForEach ($Disk in $Disks)
      {
        IF ($Disk.MediaType -eq 'SSD' -and $Disk.DeviceId -eq '0')

          {
            $TSEnv.Value('TSOsdDisk') = "0"
          }

        ELSEIF($Disk.MediaType -eq 'SSD' -and $Disk.DeviceId -eq '1')

          {
            $TSEnv.Value('TSOsdDisk') = "1"
          }
     }

}

ELSE
    {
      Write-Output -InputObject 'Only one disk or no SSD-disk present, OSD is 
now DISK 0'
    }


//Peter

Från: [email protected] [mailto:[email protected]] 
För Atkinson, Wade A
Skickat: den 19 oktober 2017 19:01
Till: [email protected]
Ämne: [MDT-OSD] RE: Image second drive

We had a similar situation with some Dell M3800s.  M2 drive showed up as drive 
one.

Ultimately what we did was created custom TS steps triggered if it was that 
particular model and the machine had 2 drives.  We used a WMI query to 
determine the number of drives

If all of these are true use alternate format and partition steps against DISK 
1 instead of 0

SELECT * FROM Win32_DiskDrive WHERE MediaType = "Fixed hard disk media" and 
Index = 0
SELECT * FROM Win32_DiskDrive WHERE MediaType = "Fixed hard disk media" and 
Index = 1
SELECT * FROM Win32_ComputerSystem WHERE Model = " HP EliteDesk 800 G3 "        
                     *you would need to verify this in WMI

You would need to do something similar to keep the standard format from 
occurring and formatting disk 0 first if you don't want that to occur.  Or if 
you don't care about disk 0 being formatted, you could just run this step 
after.  As long as you are still setting the same variable (typically OSDisk) 
on where the Apply Operating System Image step is going to apply the WIM to 
everything else should work fine.

Good Luck,
Wade





From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Neemann, Mark
Sent: Thursday, October 19, 2017 8:21 AM
To: [email protected]<mailto:[email protected]>
Subject: [MDT-OSD] Image second drive

We have several HP EliteDesk 800 G3 Towers that we are trying to image.  It 
comes with two hard drives in the computer.  Looking at them using diskpart, we 
want to image disk 1 because it is a 200 GB M.2 drive.  We have tried using 
several methods to image that drive but they have all failed.  We have manually 
run diskpart to clean the disk 0 but OSD still seems to want to use disk 0.  In 
the SCCM task sequence we have added task "Format and Partition Disk" for disk 
1 and set it as the boot disk but then the drive letter is D.  The only way 
that we've found so far is to disconnect the power to disk 0 while imaging then 
connect it again afterward.

Ultimately we want to image disk 1 and install the OS on it with the drive 
being drive letter C, how do we do that?

Mark
This communication is the property of CenturyLink and may contain confidential 
or privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful. If you have received this communication in 
error, please immediately notify the sender by reply e-mail and destroy all 
copies of the communication and any attachments.

Reply via email to