SCCM 2007: Add a data drive compatible with bitlocker
This script create a partition from the users data, that is compatible with the bitlocker shrink
(that don't be regused by bitlocker)
if your DVD letter is "G":
If you specify in sccm collection variable: OSDNewDVDLetter = "G" & OSDDATADriveLetter = "H", DVD letter will be "G:" and letter of the new data drive will be "H:"
If you do not specify in sccm collection variable: DVD letter will be "D:" and letter of the new data drive will be "E:" (like write in the script)
And if your DVD letter is not "G":
If you specify in sccm collection variable: OSDNewDVDLetter = "G" & OSDDATADriveLetter = "H", DVD letter will be not changed and letter of the new data drive will be "G:".
If you do not specify in sccm collection variable: DVD letter will be not change and letter of the new data drive will be "E:" (like write in the script)
DATADrive is the name given to this partition the script:
Option Explicit 'Class instance variable declarations Public sDATADriveLetterVar, NewDVDLetterVar, oDVDLetterVar, oDVDVolumeVar, oTSEnv
Dim iRetVal, iPartitionCount, sSystemDrive
Set WshShell = CreateObject("WScript.Shell")
here=left(WScript.ScriptFullName,len(WScript.ScriptFullName)-len(WScript.ScriptName)-1)
' Read Task Sequence Variable for new DVD Letter and for DATA Drive Letter
' Detect DVD Volume Letter
'if the DVD letter is equal to the new data drive letter we want:
' Defrag System Drive
' Shrink SystemDrive to create DATA Drive with "sDATADriveLetterVar"
' DefragDrive SystemDrive
' Shrink SystemDrive to Create Data Drive
' Execute diskpart.exe
Sub DetectDVD()
sDiskPartDVDFile = here & "\dectectDVDPart.txt"
Sub AssignDVDletter()
'If an usb or firewire drive could be connected when the script is running, add a function like this: |
Before assign the new data drive letter
Commenter cet article