The Realm of the Verbal Processor

Jarvis's Ramblings

Computer Association Script

Fairly recently I was talking with someone who was in the midst of an XP to Windows 7 migration. They were replacing groups of computers and using a ConfigMgr task sequence to install Windows 7 on the new computers…with the USMT integration migrating the user state. Now…before that can be done, there are a few things that have to be set up:

  1. Create a Computer Association between the old computer and the new computer
  2. Add the old computer to a collection that will run a task sequence to capture the user state
  3. Add the new computer to a collection that will install Windows 7 and restore the user state

The guy I talked with was having a very slow time manually clicking through the ConfigMgr GUI to create these Computer Associations one by one. That is an awful lot of clicks and it was obviously slowing down his ability to move the migrations along at the speed he wished.

So…I did a little internet scavenging of scripts and put them together inside a different framework. I freely admit that my main contribution to this was pulling key components out of the other scripts and putting them into a framework that worked well for this purpose. The end result is that the task that was taking several hours for him to do by hand is now accomplished in a few seconds.

First there was a script that I found referenced by several people that was originally written by a guy named Mark Nunn. His website is now dead, but I found where his “Add to Collection” script was available on myITforum.com. From this I mainly pulled the command for adding to a collection along with how to equate a computer name to the SMS ResourceID.

Second was an excellent post by Donnie Taylor. His script will create the computer association one at a time via command line arguments. It does require that the command line argument be the SMS Resource ID of the computers. His script showed the command line for creating the computer association along with having a basic logging function.

I took those two and put logic around them to create a script that will read computer names from a CSV file, query ConfigMgr to find the SMS ResourceID, then create the association and add each computer to the appropriate collection. The list.csv file expects the first column to be the computer names of the “old” computers and the second column to the the “new” computers. The script does expect a command line argument of “import” before it will do anything. Read through it carefully…you will need to set the name of your server, the path to the CSV and the path to the log file, along with setting the Collection IDs of the Capture and Restore collections that the computers will be added to.

There are definite limitations to the script. If a computer name is in ConfigMgr more than once…I honestly don’t know what it will do. I think it will grab the first one that it finds, but I don’t know for sure. I’m sure there are others, but that is a glaring one. Feel free to download and use…but as always…use at your own risk…the script is free…you get what you pay for! You can download it from my SkyDrive.

March 6, 2011 Posted by | ConfigMgr, scripting | 5 Comments

4th Annual MMS Bible Study

This is a message for anyone going to MMS 2011 in Las Vegas who would be interested in coming to a morning Bible study/prayer time. This will be the fourth year running that a group of us have met before breakfast on Tuesday through Friday mornings at the event. The group has varied from year to year based on who was able to come to MMS, but we’ve had a good turnout and some good connection time every year. I’m looking forward to reconnecting with some of the “regulars” as well as meeting some new folks.

This year I will be leading the study time again and will be taking us on a brief tour of the book of Romans. My current plan is for the first day to be a high level overview of the book and the other three days to specifically look at Romans 12. I’m early in the prep though, so that could change!

If you would like more info on the study, please email me to let me know. Same as every year, I won’t be posting location on the blog to protect the privacy of whoever is hosting the study…I will be emailing specific location information to those who email me.

Looking forward to seeing you there. Two weeks and counting!!!

March 6, 2011 Posted by | devotional, Jesus, MMS | 1 Comment

   

%d bloggers like this: