Archive for the ‘SCCM’ Category

Prompt for Password, UDA and Computer Name in a tasksequence.

October 9, 2013 11 comments

Hello. Long time since i wrote something, will try and post more frequently.

So i´ve been using a HTA app to prompt for a password at the beginning of each task sequence. Why you ask? let´s say you have task sequences for Client OS and some for Server OS, you might not want anyone to deploy those but if you set a PXE password you would need to distribute that password to everyone that needs to deploy Client.

There is a great post on all this written by Niall Brady over at Windows-Noob and most of this is taken from there. i found the HTA there and have modified it to include prompts for Primary User and Computer name Below is the HTA im not the greatest wizard with Graphics but you get the Picture.


There are also a prompt for Primary user and one for computer name you can download the HTA from

you can download a sample of the task sequence here and just copy it to your own.


To display a HTA in WinPE you need to have MDT integrated to you SCCM enviroment. i added the files to a folder called WNB and copied that to the script folder inside the MDT toolpackage source. but you can create your own package and reference that when you call the script. just make sure you load the MDT toolpackage Before the passwordprompt. Before you implement it you need to edit Password.hta with your favorite text editor The three prompts set 3 variables. ALLOWOSDBUILD wich is set YES if you input the right password, if you dont then the task sequence will fail and shutdown the computer, to change the password edit line 98, default password is password SMSTSUdaUsers wich is the built in UDA Variable that sets primary user, if you only have 1 domain change the domain\ on line 113 then you only need to input the username without domain\ first. if you have multiple domains just remove domain\ OSDComputerName wich is the built in variable that sets computer name wont go into more details on this pretty obvious. There is a check on line 104 to 109 that the username and compuername is between 5 and 10/15 characters long and the computername is changed to uppercase characters on line 114

Categories: SCCM

Application Dependencies in SCCM 2012

May 4, 2012 18 comments

A new feature in CM 2012 is the ability to set dependencies on applications. This is something that I have been waiting for and it works really well.

For example this is my deployment for AX 2012 Client.

In this scenario I needed to create 4 different dependencies that would all be installed, this is done by pressing “Add” and then adding a dependency, if you add 2 dependencies under the same group it will be “this OR that” but if you add them in different groups it will be “this AND that”.

You can for example have one group and add different versions of Visual C++ Redistributable if the application does not require the latest version it will check if any of those versions are installed, if any of those versions are installed it will skip it.

If you add 2 dependencies under the same group you can also set priority, if none of the dependencies are installed the application with the highest priority is the first one to be installed, the best way here is to only check “Auto Install” on the application you want to install if the device is not satisfying.

A dependency doesn’t have to be something that the application you are installing requires it can be anything.

I created a bunch of applications in a folder I call “Pre Reqs\Microsoft” with the most common pre requisites like SQL Native Client etc etc, stuff that I can use over and over again.

When you deploy an application that have dependencies linked to it the SCCM Client will check what decencies is already installed, if none are installed it will automatically download them and install.

This also works when doing it via task sequence.

If you check Software Center you will see the number of components it downloads if you have 4 dependencies and 1 is installed it will say downloading 4 components (3 dependencies and the program itself)

One thing to keep in mind is that if a dependency fails to install the whole deployment fails. You can see what dependency failed under deployment monitoring. I had one case where my C++ 2010 was an older version and the deployment failed because a newer version was already installed on the computer.

Categories: SCCM Tags:

SCCM 2012 Content Distribution Settings

April 5, 2012 Leave a comment


Im rolling out SCCM 2012 atm in our production enviroment and its going great! Migration jobs are running very smoothly, some hickups but that was expected.

I ran into a problem where my Task Sequences would not run and all the applications i tried to would not install in the client. In SCCM 2007 there where some problems (atleast in my setup) with this in the past, those errors where almost always permission related either with Network access account, IIS settings (Webdav…), or in some cases firewall settings. so naturally that was what i checked first but everything seemed fine. All the packages where green in status and where distributed to the right DP.

BUT! the settings for almost all my packages where “Manually copy the content in this package to the distribution point”
After i changed this to “Automatically…” and updated the DP everything started to run!

Categories: SCCM Tags:

Set screen resolution in WinPE with qres

March 30, 2012 Leave a comment

Hi again.

Setting the right screen resolution in WinPE might seem like an easy task but as i found it its not… i tried all sort of ways, editing the unattend file, setting it with tasksequence variables and whatnot, all of them worked but it was a static value so it would set the same resolution for all models. This is an example of how you could do it, im sure that there are easier ways but i found this to be the best for me.

First download qres from some site, do a quick google search. copy it to you distribution share and create a vbs script with the following code.

On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("localhost")
For Each strComputer In arrComputers
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_DisplayConfiguration", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)

If objItem.PelsWidth <= 800 then
set oShell = CreateObject("WScript.Shell")"qres.exe /x 1024 /y 768""qres.exe /x 1280 /y 1024""qres.exe /x 1280 /y 800""qres.exe /x 1366 /y 768""qres.exe /x 1400 /y 1050""qres.exe /x 1600 /y 900""qres.exe /x 1600 /y 1200""qres.exe /x 1680 /y 1050""qres.exe /x 1920 /y 1080""qres.exe /x 1920 /y 1200"
end if
If objItem.BitsPerPixel < 32 then
set oShell = CreateObject("WScript.Shell")"qres.exe /c:32"
end if

I added some standard resolutions for laptops and desktops but if you have more just add them to the script.
Now create a package with all the files and distribute it to you DP.

Open up a task sequence and add a “Run Command line step” and type in the name of the script you just created.
If you want add a Task Sequence Variable “IsVM equals false” this way it wont run if its a VM, i added it becouse it ran and changed the resolution to the highest resolution in the script and blew up the window so big that i couldn´t see the whole desktop.

Now save you Task Sequence and test it out. Make sure you have the correct display drivers in your boot image. in most cases it will work without them but in some cases specially with laptops it wont set the “optimized” resolution if the display driver is not present.

Categories: SCCM Tags:

Deploy .exe files as a MSI deployment type.

March 30, 2012 5 comments

Hello again.

I thought I would write about how to deploy an exe file as a “msi deployment type”. In many cases you don’t have access to a MSI file but still want to deploy it with all the cool features that an msi deployment type has.

First you need to .exe file of the application you want to deploy, put it under a folder in your deployment share.
for example I want to deploy Notepad++ for myself and a couple of colleagues, I could use a msi packager and create a msi package from scratch but that takes time and its such a small application that I just want to deploy to a handful of people in the IT department.

First go to Software Library > Application Management > Applications and if you want to create a new folder called IT.

Software Library

Right click the folder and choose “Create Application”

In the wizard click on “Manually specify the application information” and on the next screen input the application information

On the next screen select your language, Localized application name, User categories and browse to the .exe file to get the icon.

Catalog info

On the next screen press “Add..” this will open up a new window where we need to spevify all the information on the deployment type, so go ahead the choose “Manually specify the deployment type information”

Input a name for the application and choose language.

Now we need to input the installation information, first enter the location of the content. If you press “Browse” you will see that you can only pick MSI files so we need to manually input the installation command, in this case “notepad++.exe /S” if we want we can also specify the uninstall information, this is a little harder to find, in most cases there is a uninstall program in the installation folder, you could also check the registry for an uninstall command. In the screen below there is an error you need to type Uninstall.exe /S for it to uninstall silently.

Now press “Next”

The next step is to input information so that Configuration Manager knows if the application is already installed on the device we deploy to. So go ahead and press “Add Clause…”

In this case we specify a file present on the device if it’s already installed, if this was a MSI file it would import the product code. There is also an option to input registry information. Press OK > Next

Next step is to specify installation behavior. As everyone here want Notepad++ as you can’t live without it I choose “Install for system” and  “Whether or not a user is logged on” the most obvious difference between “Install for system” and “Install for user” is that if you install for system it will show up under Software Center and install for user will show up under the Application Catalog site.

On the next screen you can specify Requirements, I only want to deploy this if the user is a primary user for the device. So press “Add…” if you want to you can also add other requirements such as disk space, operating system, OU or even create your own custom requirement with a registry key, SQL query or LDAP query.

Now press OK > Next

Next screen is for dependencies, as this has no we skip this and press next. This can be very useful if you for example deploy Adobe flash player for Firefox you can here specify that for it to install Firefox has to be present on the device as without it it’s pretty useless.

Click “Next” on Summary, we are not back on the Create Application Wizard so just press “Next” and we are done.

Now all you need to do is distribute the content to your DP and deploy it to a Device, User or Group.

Categories: SCCM Tags: