Solved

Rename Domain Computer

Posted on 2006-07-11
5
740 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

695 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