Re: DSMOD - Read from TXT or CSV file



Consider it like this: You need to build 100 command lines for the disabling
of users using dsmod.

Your command would look like this if you did each one manually:
dsmod cn=test uesr1,ou=users,ou=company,dc=microsoft,dc=com -desc Disabled
by admin blah blah blah -disabled yes
dsmod cn=test uesr2,ou=users,ou=company,dc=microsoft,dc=com -desc Disabled
by admin blah blah blah -disabled yes
..
..
dsmod cn=test uesr99,ou=users,ou=company,dc=microsoft,dc=com -desc Disabled
by admin blah blah blah -disabled yes

What you want to do is create that command line.
The easiest way I know how would be to open that list of user DN's in Excel.
Insert a new column to the left of that, and populate it with dsmod.exe (you
may want to the FQ path to make it work), the next column would be the DN,
and the next column would be -desc disabled by admin blah blah blah and the
next column would be -disabled yes .

Select all (ctrl+a or from the edit menu bar or ....) copy. Open notepad.
Paste. Save as filename.cmd. Double-click to execute.

Does that make more sense?





"Drew" <Drew@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BFF9DAAF-DB3A-4674-90E5-8E096850746D@xxxxxxxxxxxxxxxx
> I'm not familiar with using Excel in that way.
> I'm not sure what you mean by " Insert rows to make the commands needed
> around each column inserting the DN in the appropriate spot of the
> command"
>
> all I have is a list of users object distinguised names..for example
>
> cn=test uesr1,ou=users,ou=company,dc=microsoft,dc=com
> cn=test uesr2,ou=users,ou=accounting,ou=company,dc=microsoft,dc=com
> cn=test uesr3,ou=users,ou=marketing,ou=company,dc=microsoft,dc=com
> cn=test uesr4,ou=users,ou=IT,ou=engineering,ou=company,dc=microsoft,dc=com
>
> "Al Mulnick" wrote:
>
>> vbscript code can be found here: http://www.google.com it's all over the
>> place, but there's lots of examples.
>>
>> Probably the easiest thing to do would be to use Excel to modify the text
>> file. Insert rows to make the commands needed around each column
>> inserting
>> the DN in the appropriate spot of the command. Then copy and paste the
>> entire spread*** into a notepad file. Save as .cmd and execute.
>> Should
>> be fine.
>>
>> Al
>> "Drew" <Drew@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:62707ECC-AC23-4F6F-9625-82CF1FBF528E@xxxxxxxxxxxxxxxx
>> > How can I have DSMOD read from a text file or CSV file, then make
>> > changes
>> > to
>> > the attributes of those objects.
>> >
>> > I have a TXT file with a list of DNs of about 100 user objects. I want
>> > to
>> > be
>> > able to disable all the accounts, and modify the description of all of
>> > them
>> > with something generic like "Disabled"
>> >
>> > Does DSMOD support this? I know they can handle piping from a DSQUERY,
>> > but
>> > I
>> > can't use that method in this case.
>> >
>> > Any suggestions...
>> >
>> > If anyone can point me in the direction of some VBScript code that can
>> > do
>> > the job, that might help.
>> >
>> > Thanks
>> >
>> >
>>
>>
>>


.