Prestage Computer Tool 1.0.0 – Import Computer Information into ConfigMgr and MDT
When you’re dealing with Operating System Deployment, you have most likely heard of that MDT can be integrated with ConfigMgr. If you’d combine the best from two worlds, meaning using ConfigMgr and MDT integrated, there are many things you can leverage out of that. With MDT you can enable the MDT Database, which gives you the options to define Roles, Make and Model, Locations and also Computers. Leveraging the MDT database can be extremely useful for instance if you’re environment consists of many different departments (could be created as Roles in the database) and location (created as Locations in the database). By using this you’re able to tell the task sequence what applications or packages that should be installed on a computer, if it’s in a specific Role in the MDT database. But here’s a small dilemma, how do you get the computer information into the MDT database?
This is where the concept of prestaging the computer comes in handy. This is not something new, it’s been around for ages. In all version of ConfigMgr you’ve been able to prestage (a.k.a. Import Computer Information) a computer that’s about to be installed with an operating system.
Organizations that already have some kind of Import Computer Information tool in-place or simply just use the Unknown Computer support for ConfigMgr, should really look into using the MDT database in my opinion. In order to assist with either making such a transition a bit smoother, or for those out there that are already using the MDT database together with ConfigMgr but are manually importing the information, I decided a while back to create a tool that can prestage a computer into both ConfigMgr 2012 and the MDT database.
The tool, that I’m calling Prestage Computer Tool 1.0.0, can be downloaded from the following link:
This tools requires a few parameters in order to function properly. Since the tool connects to two different data sources (ConfigMgr and MDT), they need to be specified prior running the tool. The following are the required parameters:
Should be the NetBIOS or FQDN of a Primary Site server or CAS.
The NetBIOS or FQDN of the server where MDT is installed, in addition to the MDT database.
Should be the name of the MDT database, by default the name is MDTDB.
It’s required that the information provided for these parameters are correct, or the tool will not initiate and an error will be shown.
Once you’ve successfully initiated the tool, you need to specify the information required (some parts are optional) to prestage a computer into ConfigMgr and MDT. That information is put into different text fields in the tool, here’s a short explanation of what they represent:
- Computer name
In this field you enter the name you wish the new computer to have, maximum of 15 characters are allowed.
- MAC Address
This field should contain the MAC address for the computer, this will be the unique identifier. Has to be entered int he following format: XX:XX:XX:XX:XX:XX
- Primary User
If you’re setup for UDA, you can create a primary device association with an user account directly from here by either providing the DOMAIN\useraccount directly or by searching for a user by entering only the username. Either method requires you to click the Check button or else the tool will not be able to prestage the computer.
- MDT Role
Select one of the roles found in the MDT database that you wish the computer to be a member of.
- ConfigMgr Collection
Select a collection in where a direct membership rule for the computer will be created.
How to use the tool
Once you’ve downloaded the tool, extract it from the zip container and put it in e.g. C:\Scripts.
1. Open an elevated PowerShell console and browse to where you put the tool.
2. Run the following command:
.\Create-PrestagedComputer.ps1 -SiteServer CAS01 -MDTServer CAS01 -MDTDatabase MDTDB
3. Enter the information required in the Computer name and MAC Address fields.
4. (Optional) If you’re going to create a primary device association for a user, enter the username and click on Check.
5. Select a MDT Role from the drop down menu.
6. Select a ConfigMgr collection from the drop down menu.
7. Click the Create button when you’re ready to create the prestaged computer.
If you’re adding more than one at the same time, you can click on the Clear button to start over.
I’ve put together a small video on how it works, which you can check out below.
I’d like to point out that this is the first release of this tool. If you run into any problems when you’re using it, please let me know as soon as possible so I’m able to fix it.
I hope this will help!
Principal Consultant and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Currently working for TrueSec as a Principal Consultant. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences and user groups.