Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


How to rename computer name under Domain

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,24395
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to rename computer name under Domain
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 How to rename computer name under Domain - 8/1/2005 11:44:01 PM   
  netxman

 

Posts: 99
Score: 0
Joined: 8/1/2005
Status: offline
OK.  After viewing ten pages of the forum,I decide to make the post.

In my environment there are many computers in a domain whose server is NT4 and I have got the Domain Admin right from our administrator.But I don't know how to change these computers name in the domain use vbscript.

May be change computer name of a single PC is easy,how about under a Domain ?And can I add some interactive commands in the scripts? Like popup the dialog box and let user choose Yes or No to reboot the computer.

This forum seems actively,maybe I will start my script learning from here.

Thanks.
 
 
Post #: 1
 
 RE: How to rename computer name under Domain - 8/2/2005 2:31:43 AM   
  Snipah


Posts: 1341
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
In order to change the name, the PC name must exist in the domain....

what i always do in order not to receive any errors, i throw the PC out of the domain, rename it, and re-add it....for me it is the safest

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to netxman)
 
 
Post #: 2
 
 RE: How to rename computer name under Domain - 8/2/2005 2:43:42 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
You should also sidwalk it to generate a new sid before rejoining to Domain. This is a nice utility that I use, switched from the gostwalk cause this util does a better job in XP.

http://www.sysinternals.com/Utilities/NewSid.html

_____________________________

If you can conceive it you can achieve it
___________________________________

www.spoogenet.com

(in reply to Snipah)
 
 
Post #: 3
 
 RE: How to rename computer name under Domain - 8/2/2005 2:26:11 PM   
  netxman

 

Posts: 99
Score: 0
Joined: 8/1/2005
Status: offline
Thanks two guys.

Snipah,did you use vbscript to do that ?  How many times user will reboot his computer,twice or once? Could you please give me an example vbs ? Thank you very much.

tnoonan,I downloaded the software you mentioned yesterday,but I dare not use it.I am afraid it will change some unknown settings. And I'm not sure if it can work fine under Domain.

(in reply to tnoonan)
 
 
Post #: 4
 
 RE: How to rename computer name under Domain - 8/2/2005 8:53:07 PM   
  Snipah


Posts: 1341
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
NetXMan,

I don't use VBScript for this task, merely b/c VBScript will not speed up this process...(not for what i have seen)

1) throw PC out of the domain...reboot needed...
2) rename PC...reboot needed...
3) throw PC back in the domain...reboot needed...

This is a time consuming task, but unfortunatly needed sometimes.. therefore we add the PC name in the Unattended Setup, prior to joining the domain...

Hope this helps...

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to netxman)
 
 
Post #: 5
 
 RE: How to rename computer name under Domain - 8/3/2005 12:51:05 AM   
  Country73


Posts: 710
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
Sometimes you can actually get away with only two reboots.

1) throw pc out of domain...(make sure it is actually out of the domain and states that a reboot is required)
2) Rename machine and then reboot
3) Join domain and final reboot
 
Still pretty time consuming, but this does cut down (a little) on the time it takes.

2000 / XP machines

(in reply to Snipah)
 
 
Post #: 6
 
 RE: How to rename computer name under Domain - 8/3/2005 11:59:00 PM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
I started to reply yesterday got called away then the site was brought down, oh well.  Here is an option I came across, not sure of it's usefulness as I have not used it, but it is a possiblity.
Use the commandline tool Netdom, this seems to have the ability to remove a computer from the domain, rename the computer, and add it back in.  I saw mention that the NT4 version, which will work on 2000/XP works better for adding a PC to a workgroup, not sure if this also means Removing from a domain, but it is something to try.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to Country73)
 
 
Post #: 7
 
 RE: How to rename computer name under Domain - 8/6/2005 3:37:39 AM   
  netxman

 

Posts: 99
Score: 0
Joined: 8/1/2005
Status: offline
OK,thans very much for all your care.

I got success in the second day.But I could not access this forum to tell you the result,the same in the follow days.

VBScript seems can not achieve this task,I searched almost all the google that prove it.

Like mbouchard said,only Netdom can do that.This netdom.exe is XP version which supports RENAMECOMPUTER option.

NETDOM RENAMECOMPUTER machine /NewName:new-name
          /UserD:user [/PasswordD:[password | *]]
          [/UserO:user [/PasswordO:[password | *]]]
          [/Force]
          [/REBoot[:Time in seconds]]

Use this command ,it works fine and only reboot once. Add this command into vbscript,made it only require new computer name,then enter to reboot,perfectly.

If supports remote operation,that's much better but I haven't try.

(in reply to netxman)
 
 
Post #: 8
 
 RE: How to rename computer name under Domain - 8/6/2005 3:44:18 AM   
  netxman

 

Posts: 99
Score: 0
Joined: 8/1/2005
Status: offline
Forgot to say , never use NewSid in Domain PC,that will cause Domain information missing.

For single PC and Workstation PC,NewSid is a good choice.

(in reply to netxman)
 
 
Post #: 9
 
 RE: How to rename computer name under Domain - 8/6/2005 10:30:34 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
So, renamecomputer will allow you to rename a compter while it is still on a domain?  Will need to take a look at it myself.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to netxman)
 
 
Post #: 10
 
 RE: How to rename computer name under Domain - 8/6/2005 10:25:05 PM   
  netxman

 

Posts: 99
Score: 0
Joined: 8/1/2005
Status: offline
That's right.

And netdom has more functions like join computer from workstation to domain.

(in reply to netxman)
 
 
Post #: 11
 
 RE: How to rename computer name under Domain - 8/8/2005 1:08:56 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
quote:

ORIGINAL: netxman

Forgot to say , never use NewSid in Domain PC,that will cause Domain information missing.

For single PC and Workstation PC,NewSid is a good choice.


That's funny I use NewSid on a domain with over 2500 pc's in it daily and have no issues using it. I remove the pc from domain, let it replicate removal accross domain, run newsid, generate new sid # and new pc name and add to domain. If you don't clean up your sids in domain and end up having duplicate sids in active directory your going to have issues. You don't have to take my word for it just keep doing what your doing. LOL

_____________________________

If you can conceive it you can achieve it
___________________________________

www.spoogenet.com

(in reply to netxman)
 
 
Post #: 12
 
 RE: How to rename computer name under Domain - 8/8/2005 1:34:18 AM   
  netxman

 

Posts: 99
Score: 0
Joined: 8/1/2005
Status: offline
Hello tnoonan

As I said in my first post,we are in different environment.My domain controller is NT server,there is no active directory in it.So I don't know how to clean up old sids in the Domain.

Don't you think Netdom is much convenient than Newsid ?

(in reply to netxman)
 
 
Post #: 13
 
 RE: How to rename computer name under Domain - 8/8/2005 2:12:09 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
Dup sids will not be an issue in NT Domain, Untill you migrate over to 2000 or 2003. It will migrate all computer, user sid accounts over to active directory depending on how you do the migration. If your going to be on nt forever, then don't worry about it, but I doubt that will be the case. There are plenty of articles out there that show you how to clean Your PDA "Nt" before migrating.

Here is a link Showing you that dup sids not an issue in NT Domain

http://www.appdeploy.com/articles/sids.shtml

But Like I said, when Migrating to Active Directory, Beware, Research, Research, Research.

_____________________________

If you can conceive it you can achieve it
___________________________________

www.spoogenet.com

(in reply to netxman)
 
 
Post #: 14
 
 RE: How to rename computer name under Domain - 8/8/2005 2:56:04 AM   
  gdmix

 

Posts: 5
Score: 0
Joined: 8/2/2005
Status: offline
Ghost Console will also perform the task although there is a lot of room from improvement in the program. Since we use static IPs, it's handy because it allows you to change DNS, WINS, etc, as well.

(in reply to tnoonan)
 
 
Post #: 15
 
 RE: How to rename computer name under Domain - 8/9/2005 12:45:09 AM   
  netxman

 

Posts: 99
Score: 0
Joined: 8/1/2005
Status: offline
Hi,tnoonan, does these automatically completely in one step ? Or I need to do step by step ?

"I remove the pc from domain, let it replicate removal accross domain, run newsid, generate new sid # and new pc name and add to domain."

(in reply to netxman)
 
 
Post #: 16
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to rename computer name under Domain Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts