Import Computers into MDT

When migrating from SMS2003 or another deployment solution to SCCM 2007/MDT, one of the challenges are to import the computers into the MDT database so they are present when a computer needs to be re-installation is necessary. Michael Niehaus have written a great article and powershell cmdlet which I have used a couple of times now and it works great, you can download it here at Michael Niehaus blogg.
This is an example of how to do it:

  1. Create a report in the new SCCM environment which contains the clients which needs importing into the MDT database, with name and UUID.
  2. Export it to a CSV file
  3. Remove all entries with blank if any UUID.
  4. Add roles to be imported for the computers in the CSV file, for instance roles used during deployment perhaps OS version. In this example two columns for roles as displayed in the example below:


  1. Then import the CSV file using powershell script
  2. The powershellscript in this example will do the following:
    1. Import the computer and UUID, if the UUID doesn’t already exist in the MDT database
    2. Add the roles to the imported object.

As always test the script in a test-environment before using it in production!:

Import-Module –name C:\MDTDB.psm1

Connect-MDTDatabase –sqlServer SCCM1 –database Deployment

$machines = Import-Csv C:\mdtimport.CSV


For ($i=1; $i -le $machines.count; $i++)


$machineid = get-mdtcomputer -uuid $machines[$i-1].uuid

if ($machineid -eq $NULL)
“New machine”
   New-MDTComputer -uuid $machines[$i-1].uuid -description $machines[$i-1].name -settings @{

   $machineid = get-mdtcomputer -uuid $machines[$i-1].uuid
   set-mdtcomputerrole $ $machines[$i-1].role1 , $machines[$i-1].role2



Then you are ready to install computers using your new SCCM+MDT environment.





Add a Comment

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.