PC Deployment with SCCM and MDT

Latest News

  • USMTGUI migrates user profiles to Azure AAD
  • SCCM – Installing intrusive Applications…
  • Remove keyboard layout from Windows 10
  • WSUS fail – Reset defunct WSUS
  • network connection check with Powershell
  • Home
  • SCCM Pages
  • Videos
  • Self-study Guides
  • All Posts
  • Tips & tricks
  • About US

SCCM Task Sequence Reinstall User warning.

Feb 20, 2018 Thomas Ehler Uncategorized 0


Reinstall User warning for Task Sequences.

How a Powershell script can be implemented in a TS, to give Users a “last resort” Cancel option,
if the wrong PC is about to be installed…

Inspiration from here, and with guidance from Nickolaj Andersen:
http://www.scconfigmgr.com/2013/10/02/prompt-for-computer-name-during-osd-with-powershell/#comment-53829

First: Build a package

To facilitate this I use a small SCCM package, without a program,  containing the Powershell script and ServiceUI.exe.
The content for the package is zipped in ConfirmTScontinue_SCCM_Package_files.zip
Create the package (and remember to Distribute it 🙂 )

In the Task Sequence you need to do 4 things.
  1. The content of the whole original Task Sequence needs to go in one Group and above that group you add a “Pre-install Check” group.Preinstall_TS_pic1
  2. In the Pre-install Check group, select “Add”,  “General” and “Set task Sequence Variable”
    The Task Sequence variable name must be “UserResult” to comply with the Powershell script. Set it to “True” (no brackets)Preinstall_TS_pic2
  3. Next Add a “Run Command Line” step (i call it “Wait for UserConfirmation“) with the following command:
    ServiceUI.exe -process:TSProgressUI.exe %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File ConfirmTScontinue.ps1
    (Translation: With the ServiceUI messenger (and within the TS environment) the Powershell script is loaded… – yes, took a while to figure out. And a gain thank you Nickolaj)
    Preinstall_TS_pic3a
    a. Select the package
    b. and, in TS installing a 64bit OS, you MUST select “Disable 64-bit filesystem redirection”.
    – If not, the 32 bit Powershell will be called and nothing is returned to the TS.

    As we only need the warning when the TS is starting from within a running Windows (not in a PXE boot scenario) we must also set a condition on when to actually ask
    :Preinstall_TS_pic3b
  4. Finally we need to use a condition to make the original TS skip, if the variable “UserResult” is set to False:Preinstall_TS_pic4

And that is another way to use a week at work… I hope you will benefit from it, avoiding unexpected reinstalls.


USMT migration of Edge favourites and Sticky Notes ConfigMgr-SQL-recommendations.xlsx

Thomas Ehler

Related articles
  • USMTGUI migrates user profiles to Azure AAD
    USMTGUI migrates user profiles to Azure...

    Jun 11, 2020 0

  • SCCM – Installing intrusive Applications…
    SCCM – Installing intrusive...

    May 29, 2019 0

  • Remove keyboard layout from Windows 10
    Remove keyboard layout from Windows 10

    Apr 09, 2019 0

  • WSUS fail – Reset defunct WSUS
    WSUS fail – Reset defunct WSUS

    Aug 09, 2018 0

More in this category
  • USMTGUI migrates user profiles to Azure AAD
    USMTGUI migrates user profiles to Azure...

    Jun 11, 2020 0

  • SCCM – Installing intrusive Applications…
    SCCM – Installing intrusive...

    May 29, 2019 0

  • Remove keyboard layout from Windows 10
    Remove keyboard layout from Windows 10

    Apr 09, 2019 0

  • WSUS fail – Reset defunct WSUS
    WSUS fail – Reset defunct WSUS

    Aug 09, 2018 0


Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • USMTGUI migrates user profiles to Azure AAD
  • SCCM – Installing intrusive Applications…
  • Remove keyboard layout from Windows 10
  • WSUS fail – Reset defunct WSUS
  • network connection check with Powershell
  • SCCM State Migration Point Creation
  • USMT XML files improved and updated for USMT 10 and Windows 10
  • USMT migration of Edge favourites and Sticky Notes
  • SCCM Task Sequence Reinstall User warning.
  • ConfigMgr-SQL-recommendations.xlsx

Recent Videos

  • Building the Perfect Windows 8.1 Image

    Building the Perfect Windows 8.1 Image

    Mar 13, 2014
  • Master ConfigMgr 2012 R2 with a Limited Budget

    Master ConfigMgr 2012 R2 with a Limited Budget

    Mar 13, 2014
  • #3 SCCM2012 Application Management Part 1

    #3 SCCM2012 Application Management Part 1

    Mar 10, 2014
  • #2 SCCM 2012 Infrastructure Technical Overview

    #2 SCCM 2012 Infrastructure Technical Overview

    Mar 10, 2014
  • #1 SCCM 2012 Technical Overview

    #1 SCCM 2012 Technical Overview

    Mar 10, 2014

Recent comments

  • User State Migration Tool (USMT) Troubleshooting - EhlerTech on USMT – User State Migration Tool Errors
  • Mark H on Upgrade to Windows 10 with SCCM
  • SCCM Deploy – SCCM 2012 Comprehensive guides by Prajwal Desai on Post 1. Setting up VMware AD and SCCM 1511
  • SCCM Deploy – Post 1. Setting up VMware AD and SCCM 1511 on Post 4. Setup SCCM 2012 1511
  • SCCM Deploy – Post 3. DC – Setup DHCP and if needed KMS on Post 4. Setup SCCM 2012 1511
Copyright 2014 / All rights reserved