Rename Computer Vbs Script

I need help with a script that will remotely rename a computer that is part of Active Directory. I would like to use psexec or something that will allow me to do this without login on to the computers. They are running windows 7. Thanks a lot.
Who is Participating?
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.

akq-HHIT ArcitectCommented:
no script needed....

netdom renamecomputer old-name /newname:new-name /userd:administrator

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
begeorgeAuthor Commented:
This command is great. However is there
A way to rename multiple machines at once? Thanks in advance
akq-HHIT ArcitectCommented:
You could use powershell.

Here is an example:
Create a txt file with all computers and accounts (or use Excel and export to csv)


create a powershell script:
$computers = Import-Csv c:\scripts\computers.txt
foreach ($c in $computers) {
	"netdom renamecomputer $($c.OldName) /NewName:$($c.NewName) /UserD:$($c.Account)"
	#netdom renamecomputer $($c.OldName) /NewName:$($c.NewName) /UserD:$($c.Account)

Open in new window

Line 1 prints out all commands (line 2 would execute them directly)
And if you need different parameters, simply adjust your csv file.

Another easy way is to create all commands in Excel using string concatination and auto fill.
Copy and Paste the results to a console to execute them.

I tried to build a small sample but unfortunately my Excel Version is german. (german commands)
begeorgeAuthor Commented:
Will this script prompt me for a password every time it executes line 2?
akq-HHIT ArcitectCommented:
Same password for all Computers? Add it to your command line. (/PasswordD:password)

Diffent Passwords?

Adjust your csv file like this....


and add one additional parameter at the end of line 2:  /PasswordD:$($.c.Password)
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
VB Script

From novice to tech pro — start learning today.