JustinL Posted June 10, 2013 Report post Posted June 10, 2013 Hello, Since moving to CM2012 I’ve been struggling to get my diskpart script that I used in CM2007 to work. The obvious difference between the two is that in my 2007 environment was set to access content directly from the DP and in 2012 I’m trying to stick with the default of download content locally. Here is my senario. The workstations have 1 disk with two partitionsC: OSDiskD: Data PartitonE: ROM Drive Because of some custom software we run I need the data partition (D:) reassigned to (E:) then in turn the ROM Drive (E:) reassigned to (D:). to accomplish this I run the following run cmd line from my diskpart packagediskpart.exe /s diskpart.txtdiskpart.txt looks like this:select volume Eassign letter Jselect volume Dassign letter Eselect volume Jassign letter Drescanexit This was very straight forward in CM2007 when accessing content from the DP but has become troublesome in 2012 because of the fact that the content needed to run the diskpart script in cached locally in the D:_SMSTaskSequence folder. The script itself runs fine until D: is reassigned to E: and the TS cant find the file anymore and bombs. I know i can always go through and set the packages and the deployment to run from the DP but I’d really like to try and stick with the recommended setting of download locally unless there is no other option. From what I understand the _SMSTaskFolder is defaulted to the drive with the most space. Is there a way that i can hard set the folder to C: instead? This seems like it should be a very simple step but I’ve been struggling with it for a week now. Any ideas on how to get the accomplished successfully would be appreciated. Thanks,Justin Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted June 10, 2013 Report post Posted June 10, 2013 Just run this step as very first during the Windows Phase and not during the PE Phase. That should do the trick. Or ... Only reassign the drive letter for the DVD drive in your diskpart script, just before the partitioning step. Then you can directly assign drive E to your data Partition during the partitioning. Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted June 11, 2013 Report post Posted June 11, 2013 Funnily i was running into a similar problem today, while i was trying to reimage a Bitlocker encrypted Lenovo Helix with Windows 8 x64 in UEFI mode. You also can't use diskpart there, because the TS can't store the script file. So i tried a totally different approach by using the Storage Cmdlets of Powershell v3, which worked great. First i added the optional component WinPE-StorageWMI to my boot image. Then i added a command line step to the task sequence to replace the diskpart command. The powershell command to clean the disk looks like this. powershell -ExecutionPolicy bypass -command clear-disk -number 0 -removedata -removeoem -confirm:$false You should be able to translate your diskpart file into powershell. Just have a look at get-volume and set-volume commands. Here is the cmdlet documentation. Quote Share this post Link to post Share on other sites More sharing options...
JustinL Posted June 11, 2013 Report post Posted June 11, 2013 Thanks for the replies Peter. I was able to finally get this working with a little different method. In my Format & Partition step on the second partition I checked the box "Do not assign a drive letter to this partition". The task sequence still creates the partition but nothing can run from it because it has no letter assigned. With this in place the _SMSTaskSequence folder now defaults to C:\. I then added the step to run the diskpart script back into the task sequence to run right after Windows boots. The script successfully reassigns the ROM Drive to D: and assigns E: to the second partition. Justin Quote Share this post Link to post Share on other sites More sharing options...
JustinL Posted July 16, 2013 Report post Posted July 16, 2013 I ended up running in to some issues with my previous solution so I wanted to post an updated solution that has been working. I went back to Technet and started researching the TS built-in variables and came across the SMSTSLocalDataDrive variable. From Technet: SMSTSLocalDataDrive Specifies where temporary files are stored on the destination computer while the task sequence is running. This variable must be set before the task sequence starts, such as by setting a collection variable. Once the task sequence starts, Configuration Manager defines the _SMSTSMDataPath variable once the Task Sequence starts. Does exactly what I was looking for! I created a collection variable for SMSTSLocalDataDrive and set it to C: on my OSD collections and voila the the _SMSTaskSequence folder now defaults to C: no matter what. Justin 1 Quote Share this post Link to post Share on other sites More sharing options...