Menu
CCMEXEC.COM – Enterprise Mobility
  • Home
  • General
  • Configuration Manager
  • Windows 10
  • Windows 11
  • Intune
  • GitHub
  • About
CCMEXEC.COM – Enterprise Mobility

Block installation of non supported Computer models in ConfigMgr

Posted on October 23, 2012 by Jörgen Nilsson

I needed a really simple script/solution to make sure that only tested/certified Computer models are being installed so I created this simple little script for it.

  • It will prompt the user that the computer model isn’t supported
  • Logs the make/model to a log file on a share
  • Fail the task sequence

To keep it simple I use the same query as in the  task sequence to deploy driver packages to sort out if the Computer model is supported by the task sequence. So you can simply copy the query from the Apply driver package step.

verify1

Then I use ServiceUI.exe from MDT 2012 together with a vbscript to prompt the user that the Computer model isn’t supported and write to a log file. ServiceUI.exe is simply brilliant as you can interact with the user from a Task Sequence! Fantastic!

verify3

The Show Dialog step looks like this:

verify5

The log file will contain the following information

verify4

Here is the VBscript, simply change the path to the log file and create the log file as well, the script will not create the log file if it doesn’t exits.

To implement it:

  • Create the group as described above in the Task Sequence
  • Create the WMI conditions
  • Download MDT 2012 to obtain ServiceUI.exe
  • Download the dialog.vbs file and rename it to Dialog.vbs
  • Change the path to the log file(make sure everyone has permissions to the share)
  • Create the text file used as log file.
  • Create  a package in ConfigMgr (no program necessary) with the two files ServiceUI.exe and Showdialog.vbs in the source directory.
  • Create a step to show the dialog, run it from the package created.

The script can also be downloaded here Dialog.vbs

‘Script to prompt the user that the computermodel is not supported and fail the task sequence
‘Written by jorgen @ ccmexec.com
‘log file to be used
strFile = “\\sccm02.demiranda.nu\pkgsource$\log\model.txt”
On Error Resume Next
Set objWMIService = GetObject(“winmgmts:\\.\root\cimv2”)
Set colItems = objWMIService.ExecQuery(“Select * from Win32_ComputerSystem”,,48)
For Each objItem in colItems
strManufacturer = objItem.Manufacturer
strModel = objItem.Model
Next
Set TsProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)
TsProgressUI.CloseProgressDialog
‘Write log file
Const ForAppending = 8
set objFSO = CreateObject(“Scripting.FileSystemObject”)
set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
objFile.WriteLine(“Time Stamp: ” & Now & ” Manufacturer = “& strManufacturer & ” Model = “& strmodel)
objFile.Close
MsgBox “This Computer model is not supported, the installation will be aborted.” &  chr(13) & “Please contact servicedesk for assistance”, 16,”Installation aborted!”
wscript.quit(1)


'Script to prompt the user that the computermodel is not supported and fail the task sequence

'ccmexec.com

'log file to be used

strFile = "\\sccm02.demiranda.nu\pkgsource$\log\model.txt"

On Error Resume Next

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)

For Each objItem in colItems

strManufacturer = objItem.Manufacturer

strModel = objItem.Model

Next

Set TsProgressUI = CreateObject("Microsoft.SMS.TsProgressUI")

TsProgressUI.CloseProgressDialog

'Write log file

Const ForAppending = 8

set objFSO = CreateObject("Scripting.FileSystemObject")

set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)

objFile.WriteLine("Time Stamp: " & Now & " Manufacturer = "& strManufacturer & " Model = "& strmodel)

objFile.Close

MsgBox "This Computer model is not supported, the installation will be aborted." & chr(13) & "Please contact servicedesk for assistance", 16,"Installation aborted!"

wscript.quit(1)

6 thoughts on “Block installation of non supported Computer models in ConfigMgr”

  1. Peter Cashen says:
    October 25, 2012 at 9:55 am

    Hi Jorgen,

    Whats in your SetSMSTSErrorDialogTimeout Step?

    Reply
    1. Jörgen Nilsson says:
      October 25, 2012 at 10:13 am

      Hi,
      good point!
      I set the SMSTSErrorDialogTimeOut to a low value so that the Task sequence error message doesn’t stay up that long after the dialog that the computer is not certified.
      Regards,
      Jörgen

      Reply
  2. Niall Brady says:
    August 9, 2013 at 2:36 pm

    nice post Jorgen,
    one thing to note, you need to use the version of serviceUI.exe with the same architecture as the boot image that you are deploying with, so if you are using say a X64 boot image, then you must use the serviceUI.exe (same name, you can rename it to serviceUIx64.exe to have both in the same package) from C:\Program Files\Microsoft Deployment Toolkit\Templates\Distribution\Tools\x64) otherwise the task sequence will fail with an error in SMSTS.log saying “The subsystem needed to support the image type is not present. Error: 80070134”.
    cheers
    niall.

    Reply
    1. Jörgen Nilsson says:
      August 12, 2013 at 9:55 pm

      Thanks Niall, good point I will update the post, I always use the x86 boot image, but all that is going to change as well, specially with UEFI.

      Reply
  3. Gerry Hampson says:
    February 11, 2014 at 8:30 am

    Very useful post Jörgen

    Reply
    1. Jörgen Nilsson says:
      February 27, 2014 at 7:05 pm

      Thanks!

      Reply

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

My name is Jörgen Nilsson and I work as a Senior Consultant at Onevinn in Malmö, Sweden. This is my blog where I will share tips and stuff for my own and everyone elses use on Enterprise Mobility and Windows related topics.
All code is provided "AS-IS" with no warranties.

Recent Posts

  • Tip when troubleshooting unexpected reboots during Autopilot – event ID 2800
  • New settings in Intune Security Baseline Windows 11 24H2 -2504
  • Managing extensions in Visual Studio Code
  • Reinstall a required Win32app using remediation on demand
  • Administrator protection in Windows 11 – First look
©2025 CCMEXEC.COM – Enterprise Mobility | WordPress Theme by Superb Themes
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT