Page 1 of 1 1
Topic Options
#57155 - 2001-07-11 10:29 PM Changing Windows 98 "Computer Names"
Anonymous
Unregistered


I need to change the computer names on ALL windows 98 machines. In my script I have a command to write the names to an INI file
WriteProfileString "P:\Computernames\mac.ini","@wksta","Macaddress","@address")
Is it possible to change the computer names with one script with some pointers to the new name. I have 300 machines and I'm trying to get this as simple as possible.

Top
#57156 - 2001-07-11 10:58 PM Re: Changing Windows 98 "Computer Names"
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Smartin -
I've not tried, but believe the value stored in "HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\ComputerName\ComputerName", "ComputerName", "REG_SZ".

Also, if running Ethernet check
"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "HostName", "REG_SZ".

and

"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNetSup", "ComputerName", "REG_SZ"

to synchronize system name with DNS values.

You may need to explore any possible issues with locally shared drives and/or printers before implementing. Perhaps someone who has implemented can provide further guidance.

Bill

Top
#57157 - 2001-07-11 11:14 PM Re: Changing Windows 98 "Computer Names"
Anonymous
Unregistered


Can you give an example of what a machine name is now and what you want to change it to?
Top
#57158 - 2001-07-11 11:21 PM Re: Changing Windows 98 "Computer Names"
Anonymous
Unregistered


We are changing the Windows NT naming convention for all of our users from gop_smartin to smartin and need to change all computer names to reflect the change.
Top
#57159 - 2001-07-11 11:30 PM Re: Changing Windows 98 "Computer Names"
Anonymous
Unregistered


So is there a set number of characters that you want cut off the beginning? If that's the case, it should be real easy.
Top
#57160 - 2001-07-11 11:38 PM Re: Changing Windows 98 "Computer Names"
Anonymous
Unregistered


I wish it was that easy, unfortunately before I got here they would put nick names, pet names.
Top
#57161 - 2001-07-12 12:45 AM Re: Changing Windows 98 "Computer Names"
Anonymous
Unregistered


smartin, How soon would you want to do this? And for how many people would you like to implement it for? A couple year's back I created a software application to write specifically the "computername" to a PC.
I wrote a VB app to look at the LOGIN_NAME field from the registry and apply it to the correct "HKEY" value.
Are you looking at changing the PC name to their login name or something else?

Top
#57162 - 2001-07-12 02:20 AM Re: Changing Windows 98 "Computer Names"
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
smartin -
Unless you've a one-for-one replacement, I see some trouble for you here. If end users are allowed to login to any system in the domain (and with workstation naming all over the place as you describe likely no limits within User Manager) you run a risk of a user logging onto a second workstation and having that name incorrectly changed. And if systems are not on the network NBTSTAT will not help check to see if names changed before.

You can use a check file to get around this - if changed once for this user, do not change again - but how do you manage that the user is properly logging into the workstation that should reflect their name when you first install your script?

The INI file you mention will be useful as long as users only log onto 1 machine in the domain. But any duplicate entries will need to be investigated further.

Be interested in seeing your code when completed.

Bill

Top
#57163 - 2001-07-12 05:01 AM Re: Changing Windows 98 "Computer Names"
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

See also topic
http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=002151
Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#57164 - 2001-07-12 11:59 AM Re: Changing Windows 98 "Computer Names"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Well.
if you have DHCP it's not unpossible to control the names. you can change name of client every minute if you like.
but the problem can lack of M$'s support for DHCP!
I mean, I haven't yet found a swithc to enable in wksta the dhcp-naming.
it works just fine on linux'es (believe in unixes too).
if ye get it working, that can be the solution.
if not:
win9x has the problem of poor admin support (thou it's the buyers on foult), so prob you have to go to every machine to change it from their gui.
and if you have more than 20 wksta's there, it's not nice, especially if you're even little bit lacy (like most people are).
_________________________
!

download KiXnet

Top
#57165 - 2001-07-12 02:48 PM Re: Changing Windows 98 "Computer Names"
Anonymous
Unregistered


I have close to 150 PC's that need to have the computernames changed. I have already changed they ID's to the current format as well as the users home drives.

This is the last step that I have to do and don't want to visit each workstation.

Top
#57166 - 2001-07-12 04:20 PM Re: Changing Windows 98 "Computer Names"
Anonymous
Unregistered


If it doesn't matter what machine gets what name, just make a list of names in an INI file like this:

[Workstations]
WKSTA001=0
WKSTA002=0
WKSTA003=0
WKSTA004=0

The script should first check if it's name has been changed yet. It should check HKLM\Software\YourCompany'sName\NameChangeScript and whatever value. Something like "Changed" should be equal to 1. If it is, then the script quits, otherwise, it runs thought the INI file with READPROFILESTRING until it finds an entry with a 0. It should instantly update that entry to 1, and then save the name in the registry. Then it should go about the procedure of changing the machine name, and finally update its registry indicating that its name has indeed been changed via script.
-Steve O

Top
#57167 - 2001-07-12 04:30 PM Re: Changing Windows 98 "Computer Names"
Anonymous
Unregistered


The Computernames will be the same as the logon ID
Top
#57168 - 2001-07-12 07:20 PM Re: Changing Windows 98 "Computer Names"
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
smartin -
To recap, you have no cross-reference between current machine names and new names, correct? And new names are to be user login id?

Perhaps you use a message box asking the end-user if logged into their pc or someone elses, and depend upon end-users to help out here. If user responds 'Yes', begin rename process and write check file at end. If 'No,' bypass and perhaps send admin alert.

Have a check file named <userid.txt> so end-user can not update more than one machine. Include old name, MAC and IP address, date/time etc. Then, watch rename process over a few days, contact users logging into the machines that do not get properly updated (info in the DC security event log).

Can also check board for process to limit user login to single machine at a time to help control multiple logins during this name change.

Not the most elegant method, but will take care of the vast majority of your systems and leave you with only a few troublesome ones to correct.

Bill

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 884 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.059 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org