Just checked back to your original post. You want to disable a bunch of users? If you have a list of DNs in a text file (not sure why you’d want a CSV file), then you could just use a batch file:

 

Just ripped this out of an existing set of batch files, so excuse extraneous stuff. The following comes out of a file called “runme.bat” J

 

FOR /F "eol=; tokens=1,2* delims=, " %%i in (users.txt) do call disableUsers.bat %%i

 

And then in disableUsers.bat:

 

ECHO Disabling User: %1>> log.txt

dsmod user %1 -disabled yes

 

You’d need to have your users in a text file called users.txt, and you should get your output in a file called log.txt

 

In terms of the COM stuff – you don’t need to know anything about COM. All you need is the necessary reference material. So, to use ADO, you’d go to MSDN, look up data access, and check the reference section. You’ll see here all the methods/properties for all the various ADO objects. You use those from with _vbscript_, _javascript_, Perl, whatever. No matter what language you use, the COM objects you are instantiating are the same, and they have the same methods/properties etc.

 

Cheers

Ken  

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Kern
Sent: Thursday, 22 September 2005 10:53 AM
To: ActiveDir@mail.activedir.org
Subject: Re: [ActiveDir] disabling users

 

look, i have to confess, i've only been in IT for 4 years and have only been around pc's for about 5.

i never took a class. just read books and screwed around.

the fact that right now, my second IT gig is for a big finanical firm in NYC running their AD/Exchange and participating in their migration to a new forest, is more of a testament to my dumb luck and the general ignorance in IT than anything else.

i'm the low quality admin joe is talking about.

 

so taking that into account, learning more than 1 lang is not possible now(just had a second kid too) and perl seems the most ideal to me. its cross platform and seems somehow more "real" as a programing lang than _vbscript_ to this uneducated admin, at least in learning program constructs and such...

however, i have been studying perl and  outside of linux/unix, there is little bang for my buck from the books i've been reading.

on windows, there doesn't seem to be much to do with perl when you're first trying to learn it as opposed to on linux(at least not from most of the o'reilly books i've read)

thats probably for me,beause while i know about com/adsi/wmi/activex, i don't know how to use them in anyway and i need a good primer that i can then use within perl in someway while i learn that.

 

i don't want to be the shody admin anymore...

 

thanks. thats my story and i'm sticking to it :)

 

On 9/2/05, Ken Schaefer <[EMAIL PROTECTED]> wrote:

I would also add that _vbscript_ itself is (a) quite simple and (b) quite limited. There's not much to learn, and what there is to learn is quite simple. The power comes from being able to use COM objects. But using COM objects (their methods and properties) is exactly the same from within perl as from within _vbscript_ (or JScript or any other language for that matter). So why use _vbscript_? There's an enormous array for pre-built scripts and tutorials out there. That's why people use _vbscript_ even through Windows Script Host supports JScript out-of-the-box as well (and JScript has extra functionality like Try…Catch error handling and short-circuited condition checking etc).

 

Cheers

Ken

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Brian Desmond
Sent: Thursday, 22 September 2005 9:29 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] disabling users

 

No.

 

I happen to know _vbscript_, VB.Net, C#, some Java, little bit of C & C++, little bit of _javascript_, some PHP, T-SQL. I actually see a need to learn to write perl. I can read it well enough just knowing how to read various other programming languages. I could stand to learn to do C++ better too. I'm not a programmer, I just run a big AD deployment.

 

You'll find that _vbscript_ works on most any Windows box wheras perl you need the activestate stuff which you can't always install on the box.

 

Thanks,
Brian Desmond

[EMAIL PROTECTED]

 

c - 312.731.3132

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Tom Kern
Sent: Wednesday, September 21, 2005 6:56 PM
To: ActiveDir@mail.activedir.org
Subject: Re: [ActiveDir] disabling users

 

you don't think one can get by in IT with just one lang?

can't you do everything in perl that you can do in _vbscript_ and then some?

I'm sure you can get by on windows with just perl.

i'm in a multi platform enviorment and frankly i just don't have the time to learn both _vbscript_ and perl.

i would end up just knowing both a little and badly.

my brain can't keep jumping from one to the other and in scripting, if you don't use one lang for a while, you forget it.

in which case i'd just end up bugging you guys on this list again for examples.

i'd like to get to the point where i can do it myself and trying to learn both will never work for me.

i have a hard enough time keeping as much as i can about windows and AD and exchange and some linux stuff in my head.

2 scripting langs will make my head explode. i'll never remeber them at all.

i just need to learn one and devote myself to learning it well instead of being a scripting jack of all trades and master of none.

 

as to perl books, then where can one lern COM on perl?

 

thanks alot guys!

 

On 9/21/05, Brian Desmond < [EMAIL PROTECTED]> wrote:

Joe Richards might know some Win32 Perl resources.



_vbscript_ isn't that hard, really. If you know the COM & ADSI stuff for Perl
as far as methods, names, etc, its just a different syntax for using it.
_vbscript_ you have the advantage of the technet scriptcenter which has
examples complete enough to copy and paste together and run.


I'm not a CS major either, I don't even have any formal training in this
field. The only things I've been taught in a classroom are how to read,
write, and do some math. Everything I know I learnt going to work everyday
and doing new things, asking questions here and there around this list and
other places. I realized I needed to learn _vbscript_ and so I started
tackling projects with _vbscript_s, and with a bit of work I got to be pretty
good at it. I still need a copy of the platform sdk on my other monitor to
remember methods, parameters, etc, but I know the syntax. That said, if I'm
feeling lazy I still go and piece things together with scriptcenter
snippets.

My point here is that it would probably be long term beneficial to you to at
least be able to do simple things in _vbscript_ like read a file, run a
external command, etc. As I said in my first message, if you post what you
have, I'll try and edit it as an example for you.


Thanks,
Brian Desmond

 

Reply via email to