Solved

Rename Domain Computer

Posted on 2006-07-11
5
729 Views
Last Modified: 2008-02-01
Hi Guys

I am rolling out about 50 or so new PC's in my organization. These will be replacing existing machines. I have a script to name the new machines and add them, but I want to add into my login script a way to change the names of the existing computers to (%COMPUTERNAME% & "-OLD") if the computername is found in a list of computernames provided by a text file.

My mission for this is so that I can remove the old systems after deployment is done. My logon script is currently a vb script and the domain computers are a mix of Windows 2000 and Windows XP Pro.

Any help would be great!! The script would be better :-)
Thanks
0
Comment
Question by:TGignac
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
fostejo earned 250 total points
ID: 17085808
TGignac,

Have a look at WSName.exe available at http://mystuff.clarke.co.nz/wsname.asp - its datafile mode allows you to name computers based upon a variety of attributes.

For instance, if your datafile (PCNames.txt) contains the following:

PC1 = PC1.OLD
PC2 = PC2.OLD
LAPTOP1 = LAPTOP1.OLD

you could call the following command to rename the appropriate computers via the login script:  wsname  /RDF:"PCNames.txt" /DFK:$CURRENTNAME

Hope that helps..
0
 
LVL 1

Author Comment

by:TGignac
ID: 17086505
thanks fostejo... what a find... my command didn't seem to work for me though...

Because the machines are on a domain I have to ensure that they don't get removed from it when the name changes... and have to be able to add them back to the domain when done.

this is the exact command left out minus the secure info you don't need:

Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
wshShell.Run "wsname /RDF:pcnames.txt /DFK:$CURRENTNAME /RCID /USER:<mydomain>\administrator /pass:<password>", TRUE

I have both files, pcnames.txt and wsname.exe in the <SERVER>\NETLOGON folder.

pcnames.txt looks identicle to your example except I used a -old as opposed to .old

Any ideas?
0
 
LVL 1

Author Comment

by:TGignac
ID: 17087992

After looking even further, I found this in the wsname.Log

7/12/2006 1:38:50 AM : Call to Rename Computer in Domain returned error 1219 (session credential conflict)
7/12/2006 1:38:50 AM : You have an exisitng connection to the server with a different username
7/12/2006 1:38:50 AM : Rename Failed
7/12/2006 1:38:50 AM : Terminate                 : Exit code 6

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question