June 7 2013

SCCM 2012 – Run action after Task Sequence is finished

In the past it has been fiddly to get an action to run after a SCCM Task Sequence has completed. Service Pack 1 of SCCM 2012 includes 7 new task sequence variables (http://technet.microsoft.com/en-us/library/hh273375.aspx), one of which is SMSTSPostAction.  This is extremely simple to use – just add a task sequence variable anywhere in the Task Sequence and this command will run after you task sequence completes. It’s simple and it works well. In my example below, I delete a directory after the task sequence completes:

SMSTSPostAction



----------------------------------------------------------------------------
I use a maximum of one Google Ad per post to help offset some of my blog hosting costs.

----------------------------------------------------------------------------

January 24 2013

Popup message during SCCM task sequence in full OS

So it’s pretty easy to create a VB script popup during a task sequence when it is running in WinPE, however it’s a bit more difficult to have a VB script popup to show to the user when the task sequence is still running in the full OS – eg Windows 7 with a user logged on.

 

This is one method that I used to get it working, maybe there are easier or cleaner ways, but this one works well for me. We can achieve something like this:

Popup

 

In the task sequence, somewhere after the MDT Use Toolkit Package step, add a command line step:

TS Warning

 

Use the following command line:

“%ScriptRoot%ServiceUI.exe” -process:tsprogressui.exe %SYSTEMROOT%system32wscript.exe “%ScriptRoot%Warning.wsf”

 

This is the warning VB script (Warning.wsf) that I’ve used in my example, you just need to put this in your MDT scripts folder:

 

<job id=”setEnv”>

<script language=”VBScript” src=”ZTIUtility.vbs”/>
<script language=”VBScript”>

Dim oTSProgressUI
set oTSProgressUI = CreateObject(“Microsoft.SMS.TSProgressUI”)
oTSProgressUI.CloseProgressDialog()

MsgBox “Popup warning message to go here. This is shown in the user session.” & chr(13) & chr(13) & “Press OK to continue.”,0, “Warning”

</script>
</job>

 

 

There is also a bit of info over here on ServiceUI.exe – http://blogs.technet.com/b/cameronk/archive/2011/01/25/can-i-use-serviceui-exe-to-launch-other-programs-besides-the-udi-setup-wizard.aspx

 

 

July 11 2012

Deploying printer drivers during SCCM task sequence

I recently had a requirement to pre-populate the Windows 7 Driver Store with some printer drivers so that non-admin users could add printers without the need to install drivers for this particular model. I utilized the PnPUtil command to do this during the SCCM Build and Capture Task Sequence which will copy and register the driver in the c:WindowsSystem32DriverStore directory on Windows 7.

Simply create a SCCM package that includes all of the driver files (.inf,.cat files etc) and then in your task sequence use a command line step to run “cmd.exe /c PnPutil.exe -i -a  C:_SMSTaskSequencePackagesxxxyyyyy*.inf” where xxxyyyyy is your SCCM package ID.  This will scan that whole folder and copy and inject all valid drivers into the OS.  I reference the C:_SMSTaskSequence directory because my task sequence is set to download first and then run.  Afterwards I found this article which does something similar but uses the %_SMSTS variable to provide the location – http://blog.coretech.dk/mip/personal-note-no-5-make-driver-available-for-none-admin-user/ – so if you run from the DP then this may be more useful.

 

February 27 2012

Printer migration with SCCM and USMT 4 hardlinks

I recently had a situation where I needed to migrate network printers during Windows 7 refresh and Windows XP to Windows 7 upgrade scenarios when using USMT 4 hard link, also known as offline mode. According to the Microsoft Technet documentation (http://technet.microsoft.com/en-us/library/dd560792%28WS.10%29.aspx#BKMK_4) by design this is not possible. However I still needed to get it done.  I used a new XML file called Printers.xml (orginally from MyITForum but slightly modified by me – if you are using the link here then rename it to Printers.xml from Printers.xml.txt) and then added this to my task sequence capture and restore user data steps as shown in the screenshot below:

Once the computer is refreshed or upgraded, the network printers are now there! * Note that this will only migrate the printers, not the print drivers so you may see some printers are migrated and others are not… It’s still best to use logon scripts / GPO preferences to map printers in a consistant manner..

January 5 2012

SCCM Task Sequence Monitor

This is a great tool for automatically backing up SCCM task sequences. It basically monitors task sequences and will back them up whenever anyone attempts to change one. It’s very good for version / change control when there are potentially multiple people working on task sequences.

I have implemented this before but can never find the URL for it when I want it, so here it is for all to see:

http://mdtcustomizations.codeplex.com/releases/view/65824

 

December 8 2011

Error creating SCCM TS media

When trying to create SCCM task sequence media, I was getting the following error message:

Error creating media. Error message is : A required privilege is not held by the client.. Please refer to CreateTsMedia.log to get details.

I needed to ensure that I had the ‘Manage auditing and security log’ right under ‘Computer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesUser Rights Assignment’ for the computer security policy…