Solved

Rename Domain Computer

Posted on 2006-07-11
5
708 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA Check for Character 9 69
VBA Excel: fill / replace values based on a config sheet. 5 57
Help in WHSCRIPT 9 41
DIR issue 7 47
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now