Adjust OSDDiskIndex (Max two disks)
(Useful if a device has two disk and either one can/should be the C drive. Work in combination with the step "Format and Partition Disk" and overwrites the "Disk Number" value)
Fix Drive Letter of mounted devices
(Best used in combination with conditions)
cmd.exe /V /C "FOR /F %V IN ('mountvol.exe D: /L') DO (mountvol.exe D: /D & mountvol.exe F: %V)"
(Checks if devices has one disk and device with drive letter D is an USB Drive --> Map USB from D to F Drive Letter)
(Checks if devices has one disk and device with drive letter D is an CDRomDrive --> Map CDRom from D to E Drive Letter)
Forcefully halt the task sequence
(The file does not exist and therefor generates an error, best/only to use with conditions)
Enables Task Sequence Powershell special return codes
StopTaskSequenceWithError.exe
The step before is a "Run PowerShell Script" step and may return "SomeRandomPs1ReturnCode". But the step does not support defining return codes. To overcome this issue change the powershell script or set "Continue on Error" and create this step afterwards.
If you like this collection and have some other useful commands by your own please share them in a "reply to this Topic"
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
OSD Run Command Line: One Liners
Please find attached a set of usefull SCCM OSD Task Sequence "Run Command Line" One-Liners
Show Task Sequence Name in SCCM Status Messages:
Format Disk 0 for Staging (Remove Bitlocker before downloading first Package)
Adjust OSDDiskIndex (Max two disks)
(Useful if a device has two disk and either one can/should be the C drive. Work in combination with the step "Format and Partition Disk" and overwrites the "Disk Number" value)
Set Drive Offline/Online by variable
(see: Bitlocker Pre-Provision multi Disk)
Fix Drive Letter of mounted devices
(Best used in combination with conditions)
(Checks if devices has one disk and device with drive letter D is an USB Drive --> Map USB from D to F Drive Letter)
(Checks if devices has one disk and device with drive letter D is an CDRomDrive --> Map CDRom from D to E Drive Letter)
Forcefully halt the task sequence
(The file does not exist and therefor generates an error, best/only to use with conditions)
Enables Task Sequence Powershell special return codes
The step before is a "Run PowerShell Script" step and may return "SomeRandomPs1ReturnCode". But the step does not support defining return codes. To overcome this issue change the powershell script or set "Continue on Error" and create this step afterwards.
If you like this collection and have some other useful commands by your own please share them in a "reply to this Topic"
Share this post
Link to post
Share on other sites