Rename multiple computers with a VBScript

I need to rename about 1500 computers on my domain. We are changing our desktop / laptop naming convention. The new naming convention will be Site Code - Serial number. I want to put the User Name - Computer Model - Asset Tag. I know I can get the Serial number from WMI, the rest of the info I will supply from a text file. I have seen several Computer Renaming VBScript, but it's been a long time since i've written a script. I could really use some assistance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jared LukerCommented:
The renaming of a computer is pretty straight forward....

This script should change the name locally and in AD.  You can add to it anyway you wish in order for it to do what you want it to.

Here is the code to do it..
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputers = objWMIService.ExecQuery _
    ("Select * from Win32_ComputerSystem")
For Each objComputer in colComputers
    err = objComputer.Rename("WebServer")

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jared LukerCommented:
This will still involve someone with the local and AD rights to touch and log into the computer, but the script can make it much less painful.
Can you please post a sample line from the text file that will be read?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.