Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Rename Domain Computer

Posted on 2006-07-11
5
Medium Priority
?
758 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 1000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

618 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