tags:

views:

115

answers:

1

hi I want to write a batch file to add a workstation into domine and assign the DNS ,WINS , and static ip address to that workstation.

+1  A: 

In order to join a workstation to the domain, you can use the "netdom" utility included with resource kits and support tools. For example, for Windows XP SP2 & SP3 download

Then issue the following command. NETDOM /Domain:MYDOMAIN /user:adminuser /password:apassword MEMBER MYCOMPUTER /JOINDOMAIN

For modifying network settings, use the "netsh" command. Here is an example of setting a static IP:

netsh int ip add address name="Local Area Connection" 192.168.1.101 255.255.255.224 gateway=192.168.1.1

And for DNS:

netsh int ip add dns name="Local Area Connection" 208.67.220.220
netsh int ip add dns name="Local Area Connection" 208.67.222.222 index=2

And finally for WINS:

netsh int ip set winsservers "Local Area Connection" static 10.0.0.1
esac