web analytics

Blog

How to Import a New Computer into Configuration Manager

Posted by:

To Import a New Computer into Configuration Manager

  1. Set up a connection to the SMS Provider.
  2. Query the collection where to add newly created computer account.
  3. Call the ImportMachineEntry Method in Class SMS_Site.
  4. Add the resource identifier you get from ImportMachineEntry to a collection.

Examples

Example Output

You can download the code examples from here



About the Author:

Kaido Järvemets is a developer, consultant, trainer specializing in Microsoft System Center Configuration Manager and PowerShell Solutions at Coretech. Kaido frequently speaks at European conferences and had his US debut as speaker at MMS April 2013. Kaido is well-known in the Configuration Manager communities where he’s a key player in the PowerShell game. Kaido host one of the most complete Configuration Manager PowerShell library’s in the world with hundreds of free code samples ready to download and implement – www.cm12sdk.net. Kaido has been awarded Microsoft Most Valuable Professional (MVP) in Microsoft Enterprise Client Management for his work with Configuration Manager from 2011 – to present. Kaido is the founder of System Center User Group Estonia in 2011.

Discussion

  1. rabah  September 19, 2013

    Very Useful, it works very good for me.
    One thing is if you add condition (with mac address) to check if the computer exist.
    Rabah.

    (reply)
  2. Andrew Mason  November 14, 2013

    This post is very useful. I have just got a modified version working in an SCCM 2007 environment (I didn’t see anything in the post to say anything about what sort of environments this would work in?).

    One thing I would say that might help others, is that to get Example 1 working for me I had to add an item into the “$CollectionQuery =” line.
    I needed to add “-ComputerName $SiteServer”
    between “-Class SMS_Collection” and “-Filter “Name = ‘$CollectionName'””
    Otherwise it would error (“Get-WmiObject : Invalid namespace …”)

    Thank you for this post.

    (reply)

Add a Comment