Skip to content

Automate Task Sequence Export to ISO w/ PowerShell

Featured Replies

Hey folks. Need some help here. So far, I have been able to figure out how to export an ISO file from a task sequence using powershell and it works great.

 

My issue is, the scheduled task that I have setup says that it has run successfully, however, I look in the folder (S:\SourceFiles\Applications\PowerShell\Export-ISOs\) and there is no ISO there.

I have created a task sequence to start a program to run whether a user is logged on or not and run with the highest privileges. For the Action on the task sequence, I have it start a program (powershell.exe) with the added arguments of "/executionpolicy bypass -file 'S:\SourceFiles\Applications\PowerShell\Export-ISOs\ExportISO-Server2012R2STD.ps1'".

 

The following is the powershell that exports an ISO file from the task sequence.

#Set connection to SCCM Server
Import-Module 'D:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'
CD SED:
#Create ISO
New-CMTaskSequenceMedia -StandaloneMedia -MediaInputType CdDvd -MediaSize SizeUnlimited -MediaPath "\\ew2ginw5947\SourceFiles\Images\ISO-Files\2012R2\Server2012R2-STD.iso" -ProtectPassword 0 -TaskSequenceId SED00034 -TaskSequenceDistributionPointServerName "ew2ginw5947.soloeng.prv"
Thanks in advance for any help.
Rob
!!UPDATE!!
On the way home I continued to ponder as to why the PS script would work when I ran it with my cred's and not the cred's I specified on the scheduled task. Hmmm! Cred's...
Yes, that's right, I specified cred's that the SCCM server did not know.
Needless to say, I updated the SCCM console and server with the correct cred's for the scheduled task sequence and what do you know... It works.

Edited by duckman8u2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.