Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: noobish dsadd computer script question

Reply
Thread Tools Display Modes

Re: noobish dsadd computer script question

 
 
Al Dunbar
Guest
Posts: n/a

 
      08-13-2008

"Polonius19" <> wrote in message
news:bf5684f6-daa1-4d77-b387-...
> I'm working my way through a Server 2003 book as I study for the
> 70-290 exam and I have a question about scripting using a file as a
> source for stdin.
>
> According to the book I should be able to use "dsadd computer
> <names.txt>" to add machine accounts to the domain. If I were adding a
> single machine I would use something like this:
>
> dsadd computer "CN=XP001, OU=Workstations, OU=Phoenix, DC=70-290,
> DC=int"
>
> I have 150 names in the file. I'd really like to get a handle on this.
> Needless to say, simply putting in the command with <names.txt> didn't
> work.


It seems you might have deduced that the redirection character implied a
redirection of stdin from a file. I don't think that is the case, rather I
suspect that the angle brackets are simply their way of denoting that the
parameter is the name of a file. Try it without the angle brackets, and give
the actual name of the actual file containing the required information.

> For starters, I don't see how the OUs and domain components
> could be accurate, unless dsadd is assuming the OUs and DC from the
> system running the command.


I think that it would be up to you to supply names in your names.txt file
that are valid distinguished names for computers in your network. The first
line would likely be:

CN=XP001, OU=Workstations, OU=Phoenix, DC=70-290, DC=int

without the double quotes.

> Any help would be appreciated...


I don't have the tools here, so I'm not sure if dsadd even accrpts a
filename parameter. you could create a batch script to do so like this:


for /f "delims=" %%F in (names.txt) do dsadd computer %%F

/Al


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sample Script for DSADD for Bulk Users Debra Brown Active Directory 6 10-10-2008 12:46 PM
Re: noobish dsadd computer script question Richard Mueller [MVP] Scripting 7 08-16-2008 03:46 PM
Re: DSADD COMPUTER - Doesn't work right! Richard Mueller [MVP] Active Directory 0 03-28-2008 05:14 PM
dsadd computer assistance Steve Active Directory 2 12-01-2004 02:05 PM
DSADD question Francis Scripting 1 11-03-2003 08:12 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59