Join Computers to Domain Automatically W95/W98/w2k/wxp

This is a real challenge!!!!

I have over 20,000 machines in a workgroup, they are w95, w98, w2k and wXP. I need to join them to the domain automatically.
They can all see a central server.

I am thinking that it has to go around this area. I run a batch process to run a remote command on the machines to join a domain.

Has anyone done this before? Is there an application o a script out there?

Thank you very much

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

For WinXP or better, you have the JoinDomainOrWorkGroup and the Rename method in

the Win32_ComputerSystem class.

Rename Method in Class Win32_ComputerSystem

JoinDomainOrWorkGroup Method in Class Win32_ComputerSystem

Technet Script Center > Computer Management:

Join Computer to a Domain

Rename a Computer and Computer Account

For pre-WinXP OS (and WinXP as well):

The JoinDom freeware utility found at tip 5956 at can be used.

Or you can use the command line utility netdom.exe from MS.

Latest version of netdom.exe can be downloaded from here:

Windows 2000 SP3 Support Tools

There came one updated version with SP2 as well, but I would be very surprised
if the SP3 netdom version do not work on pre SP3 computers.

More info can be found here:

Hope that helps.

My join computer to domain link is wrong.  Here it is...for XP:

Darn JSI link is wrong too.

That's for all OS's.  It could be a fallback.  Youcould create an account with privelages to simply join computers to a domain, distribute this utility and that account information out to your users with instructions as a fallback.

You main problem here is the legacy OS's...they are not designed to work with 2003
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Also...just found this link on how to automate the creation of computer accounts.  Could be useful with Windows 2000 and Windows XP accounts.  Doesn't do anything for you on the 9x operating systems though.
And lastly...netdom.exe utility:

Can be downloaded from


How To Join a Domain From the Command Line;en-us;Q150493

How to Use Netdom 2.0 to Create a Windows Computer Account on a Selected Domain

Automating the Creation of Computer Accounts;en-us;Q222525

That's all I could find for you man.  Good luck.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hey James..

For him, I think Netdom is the best solution.  As far as the 9x clients are concerned, they don't have domain accounts.  It would be helpful to install the Directory Services client on NT4 and lower workstations.

I was thinking the same thing.  I did forget to mention DSCLIENT though.  They will need that in order to see the Active Directory structure correctly.

However, he wants to 9x clients to be logged into the domain, if I understand the question correctly.  I know they don't have computer accounts, but client for Microsoft Networks still need to be configured for the user to log into the domain, rather than the local workstation which is why I posted the other info.
That info was correct - thus, no need to mention it!

I wasn't contradicting you - just filling in the blanks and reaffirming your answers.

OH...geez...NETMAN!  I didn't even know it was you.

Ahhh...well, I misread your message.  :)  Sorry...I have the flu, a fever, and thus...I am out of it.  lol.  I originally got the impression you thought I was trying to tell him to create computer accounts in the domain for the 98 machines.

Should have known better if I had looked at the author's name.  I would have reread it three times before responding to the man who saved my butt twice.  :)
But like I said...I did forget to mention DSCLIENT.  So thanks for the backup!  :)
No problem James!

Hope you get better soon.

chebastianAuthor Commented:
Sorry for the bother but here is the problem, I need to perform this remotely and automatically with no user intervention, if it is a possibility.

All the commands listed can be executed from a simple login script.  Just create a batch file and have the remote systems run it from a login script.  should be nothing to it.
For systems that are NT, 2000, XP, or 2003, you can also use a utiltity called psexec that you can download and read about below:

I do not believe it'll work for 9x based machines though.
chebastianAuthor Commented:
How do I run a login script if they are not joined to a domain? I had the idea that you would have to be logged in order to run a script. Psexec needs you to know the password of the local machine in order to run a command. (right?)

jamesreddyCommented: have a point.  LOL.  Can't believe I even suggested it.  Must be that fever of mine again.  :)

I guess then, your only alternative  is to make the batch file and put it into a location that the users can access it.  They can run it from a network share or you can email it to the users.  You're really limited in the capacity to use you pointed out, without a domain, they cannot run login scripts, and since they are 9x, they do not have machine accounts and therefore cannot run machine scripts or other utilities like psexec.exe.

If they were all NT, you'd be in the clear.  And yes, you'd need to know passwords to access the machines.  You have no alternative there.  NT security is designed to require a username and passwords to execute commands.  You have no choice in the matter and there is no way around this.  It is no different than joining a machine to the network the old fashioned way.  You'd have to log in to the local machine and join it, so you need to know the username and password.

If you're looking for a solution that does not require you to gain local access to the machine with a username and password, it does not exist.  If it did, that would contradict the idea of what NT security is all about.

Easy as pie!

Create this folder:  C:\Netlogon
Share it using the default name of Netlogon
Put your script in there - call it logon.cmd.
On the user's account properties add logon.cmd to the script field.


Script field is on the Profile tab on the user account.
For the 9x machines - you won't be joining the domain, but instead configuring the Microsoft Client for domain login.

I don't have any 9x boxes to look at, but if you download InCtrl from here:,4149,9882,00.asp

You can monitor what registry keys are modified when you change the client for domain login and create a reg file to run to do it for you.

chebastianAuthor Commented:
Question netman66,

when I create the netlogon folder and put the script in there, and in ad i chose logon.cmd in the script field. How are computers not joined to the domain use that script. Remember ther has to be no user intervention?.

Could you further explain what goes on in your solution because it seems very logical, however i think that if machines aren't hoined to the domain why would they go an look for the netlogon folder, or is that a default for workgroup machines?.

Also, could you provide a sample of the script, is it using netdom?


By default NT, 2000 and XP look for a Netlogon share for the script.  I was referring to adding the script to the local user account - but given further consideration, if you have to visit the workstation you might as well join it manually.

Yes, the script uses Netdom.exe, but like I said above if you have to go to the PC to get my first solution running you might as well join the domain while you're there instead.

Since joining the workstation requires you to be logged in as local Admin and you'll be asked for the Domain Admin account to finish there is no easy way to do this remotely.

If each location has a local "admin" then you can make a temporary user account for the domain while they join workstations for you - other than this, it's road trip heaven for you.

If you still want to toy with the script idea let me know.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.