netdom join

L

LWG

i want to use netdom.exe to create ou entries for workstations. i have a
list of machine names formatted as follows:

machine1
machine2
machine3...

how can i feed this into a batch to quickly add the machine names. The
netdom.exe syntax would be:


netdom add machine0 /d:home /ou:blush:u=computers,ou=home,dc=home,dc=com

thx all...
 
W

Walter Schulz

machine1
machine2
machine3...

how can i feed this into a batch to quickly add the machine names. The
netdom.exe syntax would be:
netdom add machine0 /d:home /ou:blush:u=computers,ou=home,dc=home,dc=com

for /f %a in (computername.txt) do netdom add %a /d:home
/ou:blush:u=computers,ou=home,dc=home,dc=com

If used inside a CMD write %%a instead of %a.

Ciao, Walter
 
L

LWG

I added the % for cmd and it worked great. I would like to ask another
question. Can I use 'for' to update a file for example:

i have a list of numbers:
1234
1235
1236
1237...

i want to put a name in front of this:

compa1234
compa1235
compa1236
compa1237...

thx again...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top