What do you want to specify in this variable? The use of a completely different image package previously imported into ConfigMgr? If so, then the best way to accomplish this is to use multiple Apply OS Image tasks and use conditions to dynamically only run one of them.
OSD built-in variable
Hi, is there a built-in variable that we can use to specify the Operation System image we will use in the Apply Operating System Image task sequence step?
We already use the OSDImageIndex variable to specify the index of the image, but we haven't found one to specify the OS to apply.
Thank you in advance and don't hesitate if you have any questions.
Microsoft Security | Intune | Configuration Manager | Deployment
2 answers
Sort by: Most helpful
-
Jason Sandys 31,421 Reputation points Microsoft Employee Moderator2021-02-16T14:48:03.32+00:00 -
Fiona Yan-MSFT 2,316 Reputation points2021-02-16T09:14:18.883+00:00 Thank you for posting in Microsoft Q&A forum.
As far as we know, it seems that there is no built-in variable to specify the Operating System Image package during our OSD process.
Here is a detailed Microsoft variable article for you to refer to:
https://learn.microsoft.com/en-us/mem/configmgr/osd/understand/task-sequence-variablesTo verify this, I have done a short test in my lab. For testing, I added two steps in my task sequence: set dynamic variables and use the OSDApplyOS.exe to apply the OS image as the original task sequence does.
1.From administrators perspective, we can get the image package information(OS name, package ID) in SCCM from PS cmdlet (like the image below) for build the task sequence variable %image_to_applied% in later use.

2.Run the following command line to specify the OS image package and image index:
OSDApplyOS.exe /image:%image_to_applied%,%OSDImageIndex% /target:1,2 /runfromnet:False
The command line may like the image below:

In short, though we can use variable for both OS image package and the index of it, it has the same functionality of the original Apply OS Image task. There is no need to do this manually. If you have any other concerns, please feel free to post.
Have a good day!
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.