Browsed by
Month: January 2015

The Easy way to Deploy Windows 10 Tech Preview using SCCM 2012 R2

The Easy way to Deploy Windows 10 Tech Preview using SCCM 2012 R2

We have all heard the news of the “Awesome” new features which we will love with Windows 10; for the most part I really do love the awesome new features. For this post I’m going to focus on the “keep everything” upgrade of Windows. Yes you herd me correctly, you can keep everything, which includes all of the tweaks you have made to your applications… how awesome is that! The best thing about the whole solution is that you can empower your staff to complete this deployment using the Application Deployment model from SCCM 2012 which I will detail below:

DISCLAIMER: this is NOT officially supported in production yet so you should really test this process in a non-production environment.

First off we need to get the ISO for Windows 10 from Microsoft which if you don’t already have it you can download it from here or MSDN if you are lucky enough to have a subscription.

We then need to mount the ISO and copy the contents into your source directory.

Once copied we then head into SCCM and browse to Software Library\ Application Management\ Applications and Create Application

Select Manually Specify the application information then Next

Fill out the pertinent General information and select Next

Complete the Application Catalog page using the Icon from setup.exe (not required but makes it look pretty) and select Next

Add a Deployment Type following the below:

Change the type to Script Installer which will automatically change it to Manually Specify the Deployment information then select Next

Fill out the name of the Deployment Type, Select Next

Define the location of your source and point to setup.exe as the installation program (for ease of documenting this I haven’t used an unattended.xml but you can in your environment if you want to reduce the user input, use /? On setup.exe to find the details for it.) Select Next

Now on the Detection Method we need to work out how to see if Windows 10.0.9926 is already installed, and confirm that it was successful after the fact to do that we are going to use a PowerShell Script which looks like this:

if (((Get-WmiObject -Class win32_operatingsystem).version).startswith(“10.0.9926”)) {write-host $true} else {}

 The version number can be changed to whatever the target version of windows is.

Select Ok

Then Next

Update the User Experience tab to look like this (making sure to extend the Max allowed
run time), then select Next

For this demo I’m going to leave the Requirements and Dependencies
empty (you might want to limit the version of windows it can target and alike), so Next, Next

Select Next on the Summary Page

Then select Close which will return you to the Create Application Wizard

Which you can select Next, Next, close to complete the creation of the application.

To deploy the application to your test users, select the Application, then Deploy from the Ribbon

As this is a test environment I’m going to use the All Users Collection (in production this should rarely happen) and then select Next

As we have just created the Application the content hasn’t been deployed, so add a Distribution Point, and select Next

Leave the Defaults for the rest of the Wizard, select Next until the end and then Close

You can now browse to your Application Catalog and select the Application we have just deployed from the Catalog.

Which will then appear in Software Center on the client, once the files download the user will be prompted to complete the standard Windows 10 upgrade prompts.

Wait an hour or depending upon how powerful your machine is, then the computer will be running the latest version of Windows 10.

Good Luck


What is the SMS Provider and Why Should I Care?

What is the SMS Provider and Why Should I Care?

The SMS Provider is the name given to the WMI Provider which SCCM leverages off to access the information from SCCM. The most common usage is to power the SCCM Console, Resource Manager, and most Console Extensions. It can be used to read and write data into the SCCM environment, and any use who has access to the SCCM Console will have access to the Provider. Traditionally the SMS Provider has been the sphere of the guys who do the crazy awesome extensions for the SCCM environment which we all leverage off to make our jobs easier. So why would we want to access the SMS Provider outside of the SCCM Console? That’s a great question. Let’s just say, for example, you want to get the serial number of a computer from SCCM. Via the SCCM Console you would need to find the Computer in the All Systems collection, then right click and select ‘Start the Resource Explorer’, browse to the PC BIOS Folder and then retrieve the Serial Number. Alternatively, using PowerShell, you can connect to the SMS Provider and can run the following script;

$servername = Get-WmiObject -Namespace root\ccm -Query “select * from SMS_authority” | select CurrentManagementPoint

$Providerdetails = Get-WmiObject -ComputerName $servername.CurrentManagementPoint -Namespace root\sms -Class SMS_Providerlocation | select SiteCode, Machine

$sitecode = $Providerdetails.sitecode

$ProviderServer = $Providerdetails.machine

$compname = $env:COMPUTERNAME

$comps = Get-WmiObject -ComputerName $ProviderServer -Namespace root\SMS\site_$sitecode -query “select * from SMS_R_System full join SMS_G_System_PC_BIOS on SMS_R_System.resourceID = SMS_G_System_PC_BIOS.resourceID where = ‘$compname‘”


Yes, I know, scary looking, right? Let’s break down what the script is actually doing;

$servername = Get-WmiObject -Namespace root\ccm -Query “select * from SMS_authority” | select CurrentManagementPoint So this section is getting the current Management Point of the Computer you are running the script from WMI (so long as the SCCM Client is installed).

$Providerdetails = Get-WmiObject -ComputerName $servername.CurrentManagementPoint -Namespace root\sms -Class SMS_Providerlocation | select SiteCode, Machine

This line returns the details for the SMS Provider from the Management Site Server for the SCCM environment which we are connected to via WMI on the Management Point from where we create Variables for the SiteCode and the name of machine with the SMS Provider is installed (if you have multiple SMS Providers/ Management Points you will have multiple results here) and for the example I have defined the variable $compname as the name of the computer running the script, but this can be changed to the machine you want to find the serial number of.

$sitecode = $Providerdetails.sitecode

$ProviderServer = $Providerdetails.machine

$compname = $env:COMPUTERNAME

The next line is where we actually call the SMS Provider, so we connect to the $Provider Server in the root\sms\site_$sitecode namespace, to execute the query to return all of the System and PC BIOS details for the current computer into the $comps Variable which we then interrogate on the next line to return the Serial Number from the SMS_G_System_PC_BIOS object.

$comps = Get-WmiObject -ComputerName $ProviderServer -Namespace root\SMS\site_$sitecode -query “select * from SMS_R_System full join SMS_G_System_PC_BIOS on SMS_R_System.resourceID = SMS_G_System_PC_BIOS.resourceID where = ‘$compname‘”


So that’s great we now have the serial number a lot quicker than finding it via the Console, but I actually want to get the last logged on user that SCCM has for that machine. Well, all we need to do is change the last line; $comps.SMS_R_System.LastLogonUserName

So we have captured the last logged on user from SCCM, and the Serial number, but what about the Operating System Version? Well we just need to change and re-run the query for comps to something like this; $comps = Get-WmiObject -ComputerName $ProviderServer -Namespace root\SMS\site_$sitecode -query “select * from SMS_R_System full join SMS_G_System_Operating_system on SMS_R_System.resourceID = SMS_G_System_Operating_system.resourceID where = ‘$compname‘” $comps.SMS_G_System_Operating_system.caption 

You will see the only thing I changed between the queries is what SMS_R_System is joined to, to return the caption (where the OS Name is contained if you didn’t know) from the Operating System Table we select the sms_g_system_operating_system.caption object from inside the $comps variable. You can also just type $comps.sms_g_operating_system and it will return all of the Properties for that WMI Class if you don’t know which Property you need. So by now you might be going, “That’s great Steve, you know what variables and tables to be looking for but how the heck am I meant to figure that out?” Well, Kaido has created this awesome Excel Sheet which details all of the Classes for WMI, both Server and Client side which you can download from here and look at the Server WMI Class Properties tab. This will detail all of the default Classes and Properties, if you have extended your hardware inventory to capture even more information it’s really easy to interrogate that information as well, as the Class will appear as SMS_G_System_ and the Properties will match what you added to the Hardware Inventory. To summarize while learning how to use the SMS Provider you might be a little longer to get the information, but in the long term it will save a whole heap of time! Good Luck Steve

User Query Tool

User Query Tool

For the past few years I have been working on and implementing a solution (User Query Tool) for the Desktop and Service Desk Teams that will allow for the discovery of the Computer Name simply by entering in a Username, or Serial Number (into the UQT).

Initially UQT was much customised to match the environment which it was built for, but over time I have been removing these deep integration points, along with moving the queries from the simple SQL queries which I ported from SQL reports with hardcoded server connection strings in the early version of the tool, to what I’ve made available today, using dynamically detected SMS Provider connections that can be used in most environments without modifications.

You can download the tool from here

How to use the User Query Tool, so when the tool starts up it will look something like this:

A list of domains which are available in your environment in the dropdown list, which is a mash up of the user’s domains from the SMS Provider & the list of DNS suffix’s on your network adaptors. This is to ensure that it’s a relevant list as both lists by themselves tend to have domains/computer names which will blow out the list. If you don’t see your domain in the list don’t fret, just type it into the field when you complete your search and it should discover the user you have searched for.

When searching on the username you can use partial matches of the username field in Active Directory. For example, I can search for user ‘hoskings’, by typing in the whole name or I can just type in ‘hosk’.

It will return all of the usernames which contain the search string, so if there was hoskings, hoskings-a, and hoskingp it would return all 3 of them which I can then select the account in question.

It is worth noting at this point that it will only return any accounts which have details associated with them, so you will only see relevant information. In future versions though, I might introduce the ability to search Active Directory first for all users which match, but this solution allows for handling of users which exist in domains you might not have access to, along with ensure that you get a fast result.

Once you have selected the user object it will complete the search for computers which the user has logged onto. For multiple computers it will return a list like this:

From here we can select the computer which is the closest match in this case we are going to use StevesRig, which we double click on and you get the following results:

If you double click on each of the text fields it will copy the information into the Clipboard for ease of use, along with the Copy All Results button which is intended to be used for lodging of tickets into your ticketing system as it contains all of the pertinent information required for when logging a ticket.

You will see in the above images that the other buttons are greyed out, they will enable when the tool can either communicate to the computer or Active Directory for the user section. Each of the of buttons do exactly what they say they do J

Please let me know if you have any feedback around this tool, you can see the code for the application at this link: