Location: List Archives

List Archives

This forum is an archive of all posts to our mailing list over the past few years.  The forum is set read only therefore to contribute you will need to join our list community.  See more info about this here.

 

When subscribed to the list you should use your standard email client to send your posts to ActiveDir@mail.activedir.org.

List Archives

Subject: [ActiveDir] disabling users
Prev Next
You are not authorized to post a reply.

Page 1 of 212 > >>
AuthorMessages
tkern@xxxx.yyy

09/21/2005 6:22 AM  
I'd like to script disabling users from a csv file. I think Joe's Oldcmp can disable users but i'd like to feed the users from a csv file since they are all over my AD.
Also, as a backup, i'd like a simillar script to enable users from a csv file.

Robbie Allen's AD Cookbook has a simillar script but you have to specify the dn of the user in the script. If someone can help me modify the script(perl or vb) to use a file instead that would be great.
thanks
.+-�w�i���+�����@Bm����+�*�ˊ�����r�zm����V�r�y����4���i�����
bdesmondUser is Offline

Posts:995

09/21/2005 6:47 AM  
Oldcomp really isn't the tool to do this. This is more an admod/dsmod type
thing. You're going to need the DN for any of the command line tools. What
do you have? The samname?

If you post your script and a sample of the csv here, I'm willing to look at
it...Have you considered trying to figure it out yourself in an attempt to
learn some vbscript, though? There are hundreds if not thousands of common
task samples on the technet scriptcenter that even someone who doesn't know
vbscript enough to write stuff from scratch can usually piece together.

Thanks,
Brian Desmond
brian@xxxxxxxxxxxxxxxx

c - 312.731.3132



-----Original Message-----
From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern, Tom
Sent: Wednesday, September 21, 2005 2:19 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: [ActiveDir] disabling users

I'd like to script disabling users from a csv file. I think Joe's Oldcmp can
disable users but i'd like to feed the users from a csv file since they are
all over my AD.
Also, as a backup, i'd like a simillar script to enable users from a csv
file.

Robbie Allen's AD Cookbook has a simillar script but you have to specify the
dn of the user in the script. If someone can help me modify the script(perl
or vb) to use a file instead that would be great.
thanks
.+-wi0-+?@Bm+v*´E?rzm Vry&-4ibb

List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
tkern@xxxx.yyy

09/21/2005 8:31 AM  
-----Original Message-----
From: Brian Desmond [mailto:brian@xxxxxxxxxxxxxxxx]
Sent: Wed 9/21/2005 2:46 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Cc:
Subject: RE: [ActiveDir] disabling users




>
hcolemanUser is Offline

Posts:133

09/21/2005 8:58 AM  
http://www.unix.org.ua/orelly/perl/sysadmin/ch06_05.htm would be a good
start
From: Kern, Tom
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern,
TomSent: Wednesday, September 21, 2005 2:30 PMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: RE: [ActiveDir] disabling
users

I only have time to learn one scripting lang.
i figured perl is the better way to go as i have to work with linux and
solaris as well.

know of any good docs,books,sites on perl and COM+ or adsi?
something that will teach you both like the _vbscript_ resources do?

i really think there is a market for perl and AD/win32 out there that is
untapped.
O'reilly has let most of their win32 perl books become outdated and stop at
Win NT as has Dave Roth.

I'm not a programmer and i don't have time to learn multipe scripting
langs, so i always thought perl would be the best way to go.
I find it as approachable as _vbscript_ but unlike _vbscript_, I don't find
many rescources for using it on win32 systems.
I'm afraid learning perl and working with windows might be an uphill
battle.
are there resources for teaching you how to use perl with
cdo,wmi,adsi,ado,etc?
i'm not a total newbie to perl, i've used it on linux but i've never really
done much on windows with activestate.
and as i've said, i'm not a programmer and i didn''t major in comp sci, so
a lot of this stuff is not second nature to me and hasn't been pounded in for
years.
so jumping from lang to lang for me is not really an option.

thanks


-----Original Message----- From: Brian Desmond
[mailto:brian@xxxxxxxxxxxxxxxx] Sent: Wed 9/21/2005 2:46 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx Cc: Subject:
RE: [ActiveDir] disabling users
pjessop@xxxx.yyy

09/21/2005 9:18 AM  
Tom

I think you should also consider Python. It has the following features.
1. Works well with windows
2. Very large functionality out of the box
3. Multi platform (Windows, Mac, Linus, Unix, Palm, etc..)
4. Simple to learn - straight forward non cryptic syntax
5. Very well supported
6. GUIs available

Inevitably one has to know VBScript as well because it is so widely
used and most Windows scripting is done in VBScript.

By the way does anyone know where Monad documentation can be found?

Peter Jessop
List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
AD00000333User is Offline

Posts:0

09/21/2005 9:23 AM  
I think the reason you don't see new Perl/win32 books is
that they more or less aren't needed. Once you learn how to do COM with Perl,
you can use the myriads of _vbscript_ resources that are out there. Once you know
what object you need, and how it works, translating to Perl is usually
trivial.
From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern,
TomSent: Wednesday, September 21, 2005 3:30 PMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: RE: [ActiveDir] disabling
users

I only have time to learn one scripting lang.
i figured perl is the better way to go as i have to work with linux and
solaris as well.

know of any good docs,books,sites on perl and COM+ or adsi?
something that will teach you both like the _vbscript_ resources do?

i really think there is a market for perl and AD/win32 out there that is
untapped.
O'reilly has let most of their win32 perl books become outdated and stop at
Win NT as has Dave Roth.

I'm not a programmer and i don't have time to learn multipe scripting
langs, so i always thought perl would be the best way to go.
I find it as approachable as _vbscript_ but unlike _vbscript_, I don't find
many rescources for using it on win32 systems.
I'm afraid learning perl and working with windows might be an uphill
battle.
are there resources for teaching you how to use perl with
cdo,wmi,adsi,ado,etc?
i'm not a total newbie to perl, i've used it on linux but i've never really
done much on windows with activestate.
and as i've said, i'm not a programmer and i didn''t major in comp sci, so
a lot of this stuff is not second nature to me and hasn't been pounded in for
years.
so jumping from lang to lang for me is not really an option.

thanks


-----Original Message----- From: Brian Desmond
[mailto:brian@xxxxxxxxxxxxxxxx] Sent: Wed 9/21/2005 2:46 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx Cc: Subject:
RE: [ActiveDir] disabling users
bdesmondUser is Offline

Posts:995

09/21/2005 9:49 AM  
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 vbscripts, 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

brian@xxxxxxxxxxxxxxxx



c - 312.731.3132





_____

From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern, Tom
Sent: Wednesday, September 21, 2005 4:30 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling users



I only have time to learn one scripting lang.

i figured perl is the better way to go as i have to work with linux and
solaris as well.



know of any good docs,books,sites on perl and COM+ or adsi?

something that will teach you both like the VBscript resources do?



i really think there is a market for perl and AD/win32 out there that is
untapped.

O'reilly has let most of their win32 perl books become outdated and stop at
Win NT as has Dave Roth.



I'm not a programmer and i don't have time to learn multipe scripting langs,
so i always thought perl would be the best way to go.

I find it as approachable as VBscript but unlike VBscript, I don't find many
rescources for using it on win32 systems.

I'm afraid learning perl and working with windows might be an uphill battle.

are there resources for teaching you how to use perl with
cdo,wmi,adsi,ado,etc?

i'm not a total newbie to perl, i've used it on linux but i've never really
done much on windows with activestate.

and as i've said, i'm not a programmer and i didn''t major in comp sci, so a
lot of this stuff is not second nature to me and hasn't been pounded in for
years.

so jumping from lang to lang for me is not really an option.



thanks



-----Original Message-----
From: Brian Desmond [mailto:brian@xxxxxxxxxxxxxxxx]
Sent: Wed 9/21/2005 2:46 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Cc:
Subject: RE: [ActiveDir] disabling users



>
tkernUser is Offline

Posts:8

09/21/2005 11:03 AM  
Message body was not found.
listmailUser is Offline

Posts:824

09/21/2005 11:10 AM  
Get the Perl PDK from the ActiveState site, that has a very
cool _vbscript_ to perl converter. It isn't perfect but is nice when trying to
figure out how to do something. I do agree that perl for win32 resources have
dried up a little, I think it is more an issue of admins than people to write
the books and docs. In my experience, when you look at the overall group of
win32 admins, most don't script, of those that do, most take _vbscript_s and try
to tweak them to make them do something. I don't visualize Monad nor DotNET
helping this. The quality of the admins have to change, not the tools unless you
can get a tool to take a poorly stated problem and create a script from it.
Those who can think in the proper way to write a script or some other automated
process from scratch are doing it, sometimes in one language, sometimes in
multiple.

Other than that, I tend to do a lot of calling out to exe's
versus using OLE/COM stuff. Most of my tools are written with perl in mind
either because I am writing them specifically to call from perl or at some point
end up doing. If I don't write at least one perl script a week that calls out to
adfind for something I don't figure the week is over. Basically if I need to
find something I use adfind over ADO. If I need to update something, I may do it
straight from ADSI or if it is too difficult in ADSI I use admod called from the
perl.

As for the rest, is there something on the user objects
that can be queried to indicate that they should be disabled? If so, then you
could use oldcmp to do it via the -af switch.

Admod, on the other hand can take a file with DNs (you pipe
it in) and then do work on those, it won't however parse out a CSV with multiple
fields.


From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern,
TomSent: Wednesday, September 21, 2005 4:30 PMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: RE: [ActiveDir] disabling
users

I only have time to learn one scripting lang.
i figured perl is the better way to go as i have to work with linux and
solaris as well.

know of any good docs,books,sites on perl and COM+ or adsi?
something that will teach you both like the _vbscript_ resources do?

i really think there is a market for perl and AD/win32 out there that is
untapped.
O'reilly has let most of their win32 perl books become outdated and stop at
Win NT as has Dave Roth.

I'm not a programmer and i don't have time to learn multipe scripting
langs, so i always thought perl would be the best way to go.
I find it as approachable as _vbscript_ but unlike _vbscript_, I don't find
many rescources for using it on win32 systems.
I'm afraid learning perl and working with windows might be an uphill
battle.
are there resources for teaching you how to use perl with
cdo,wmi,adsi,ado,etc?
i'm not a total newbie to perl, i've used it on linux but i've never really
done much on windows with activestate.
and as i've said, i'm not a programmer and i didn''t major in comp sci, so
a lot of this stuff is not second nature to me and hasn't been pounded in for
years.
so jumping from lang to lang for me is not really an option.

thanks


-----Original Message----- From: Brian Desmond
[mailto:brian@xxxxxxxxxxxxxxxx] Sent: Wed 9/21/2005 2:46 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx Cc: Subject:
RE: [ActiveDir] disabling users
bdesmondUser is Offline

Posts:995

09/21/2005 11:30 AM  
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

brian@xxxxxxxxxxxxxxxx



c -
312.731.3132





From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Wednesday, September 21,
2005 6:56 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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 brian@xxxxxxxxxxxxxxxx> 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
brian@xxxxxxxxxxxxxxxx

c - 312.731.3132

_____

From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern, Tom
Sent: Wednesday, September 21, 2005 4:30 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling users

I only have time to learn one scripting lang.

i figured perl is the better way to go as i have to work with linux and
solaris as well.

know of any good docs,books,sites on perl and COM+ or adsi?

something that will teach you both like the _vbscript_ resources do?

i really think there is a market for perl and AD/win32 out there that is
untapped.

O'reilly has let most of their win32 perl books become outdated and stop at
Win NT as has Dave Roth.

I'm not a programmer and i don't have time to learn multipe scripting langs,
so i always thought perl would be the best way to go.

I find it as approachable as _vbscript_ but unlike _vbscript_, I don't find many
rescources for using it on win32 systems.

I'm afraid learning perl and working with windows might be an uphill battle.

are there resources for teaching you how to use perl with
cdo,wmi,adsi,ado,etc?

i'm not a total newbie to perl, i've used it on linux but i've never really
done much on windows with activestate.

and as i've said, i'm not a programmer and i didn''t major in comp sci, so a
lot of this stuff is not second nature to me and hasn't been pounded in for
years.

so jumping from lang to lang for me is not really an option.

thanks

-----Original Message-----
From: Brian Desmond [mailto:brian@xxxxxxxxxxxxxxxx ]
Sent: Wed 9/21/2005 2:46 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Cc:
Subject: RE: [ActiveDir] disabling users
kenUser is Offline

Posts:173

09/21/2005 11:52 AM  
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:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Brian Desmond
Sent: Thursday, 22 September 2005
9:29 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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

brian@xxxxxxxxxxxxxxxx



c -
312.731.3132





From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Wednesday, September 21,
2005 6:56 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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 brian@xxxxxxxxxxxxxxxx> 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
kenUser is Offline

Posts:173

09/22/2005 1:39 AM  
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:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Thursday, 22 September 2005
10:53 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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
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: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx]
On Behalf Of Brian Desmond
Sent: Thursday, 22 September 2005
9:29 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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

brian@xxxxxxxxxxxxxxxx



c -
312.731.3132





From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx]
On Behalf Of Tom Kern
Sent: Wednesday, September 21,
2005 6:56 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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 brian@xxxxxxxxxxxxxxxx>
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
bdesmondUser is Offline

Posts:995

09/22/2005 1:53 AM  
If that™s the case you can just pipe the list of DNs into dsmod or
admod.



Thanks,
Brian
Desmond

brian@xxxxxxxxxxxxxxxx



c -
312.731.3132





From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Ken Schaefer
Sent: Wednesday, September 21,
2005 9:37 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling
users



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: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On
Behalf Of Tom Kern
Sent: Thursday, 22 September 2005
10:53 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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
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: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx]
On Behalf Of Brian Desmond
Sent: Thursday, 22 September 2005
9:29 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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

brian@xxxxxxxxxxxxxxxx



c -
312.731.3132





From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx]
On Behalf Of Tom Kern
Sent: Wednesday, September 21,
2005 6:56 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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 brian@xxxxxxxxxxxxxxxx>
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
Alm@xxxx.yyy

09/22/2005 2:45 AM  
Been re-reading the Oreilly Learning Perl book. So far so
good but I have to admit, I've learned several languages in the past and have
a minor foundation in assembly and c coding (I believe I drank away
that part of memory, but I have it written down that I took some of those
classes at a cc a while back) and so this is just another language that
translates what I think into 1's and 0's at some point.  I don't
have a lot of reason to write in c/c++ these
days.  

Moving between c# and vb.net is relatively easy
(format syntax type of things), but a little more effort going between perl and
_vbscript_. 

Free advice? For administrative languages, learn both perl
and _vbscript_ if that's the environment you're in.  One of the two
will likely be available to you to use on whichever platform you want to
work with.  It's not as likely that both will be available on all
of the platforms. Each has it's strengths and weaknesses
depending on the task, but using the right tool for the job is the
better way to go. 


al



From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom
KernSent: Wednesday, September 21, 2005 8:53 PMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: 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 Ken@xxxxxxxxxxxxxxxx> 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: ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Brian DesmondSent: Thursday, 22 September 2005 9:29
AMTo: ActiveDir@xxxxxxxxxxxxxxxxxxSubject: 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
brian@xxxxxxxxxxxxxxxx

c -
312.731.3132






From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom KernSent: Wednesday, September 21, 2005 6:56
PMTo: ActiveDir@xxxxxxxxxxxxxxxxxxSubject: 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
brian@xxxxxxxxxxxxxxxx> 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 hasexamples 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 thisfield. 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 andother places. I realized I needed to learn
_vbscript_ and so I startedtackling 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 toremember methods, parameters, etc, but I know
the syntax. That said, if I'mfeeling 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 atleast be able to do simple
things in _vbscript_ like read a file, run aexternal 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
listmailUser is Offline

Posts:824

09/22/2005 2:48 AM  
Any language can be done in a write once, read never
format. Readabilty is a function of the person writing the code, the language
can only help you accomplish what you are trying to do and are capable of. If I
saw code that was tough to read, in any language, I stick the blame firmly with
the person who wrote it, where it belongs. I have run into situations where I
have seen thousands of lines of _vbscript_ that I simply threw away because the
logic couldn't be followed due to how the script was written, generally I
replaced it with hundreds of lines of clearly written perl that anyone could
read. If you write perl well, it can be nearly self documenting. But that isn't
enough, you still comment the code to explain intent and what the purpose of
different things is.

If I had to argue for a least readable language, I
would argue for cmd batch, but again, it is about the person writing the code,
not the language the code is written in. I have even seen ASM that was written
so cleanly and well with comments that anyone could follow
it.

I think the problem a lot of people have with perl is its
flexibility. TIMTOWTDI. It is the core design of the language, a loop can be
done in many different ways instead of 1 or 2 ways that someone may be used to
seeing. For some people, giving flexibility to them is like giving them a longer
and longer rope to hang themselves.

As I once read in one of the books or heard from a friend
or something... Perl is like playing the guitar, you can usually do something
pretty quickly, but the really cool stuff will take practice. But on the
positive side, it is possible to do the really cool stuff and usually in a way
that makes you feel good.

I just
had a bit of a conversation with one of the Exchange Dev folks who was saying
that with Monad, if I want to get some piece of info about a mailbox from
an Exchange 12 server I have to return all of the info from the server and then
filter out what I don't want to use. The reason given was that is the Monad
way... I visualize that like trying to output whenChanged of an object and
having to pull all attributes of the object to do so. There is a tremendous hit
to efficiency if that is the way it is done. The big thing that scared me though
was the comment... that is the Monad way... What is the way? To assume you have
unlimited bandwidth and time so you can be fat and
inefficient?

  joeΏ]



Ώ]
Slowly emerging from being way too submerged in work and other things...



From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Roger
SeielstadSent: Thursday, September 22, 2005 2:28 AMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: RE: [ActiveDir] disabling
users

Honestly, I'd avoid perl like the plague. Its about the
least readable language on the planet - especially if you haven't touched a
script for a few months.
As was already suggested, python is a pretty good cross
platform option.

--------Roger SeielstadE-mail Geek

From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom
KernSent: Wednesday, September 21, 2005 3:56 PMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: 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 brian@xxxxxxxxxxxxxxxx>
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 hasexamples 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 thisfield. 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 andother places.
I realized I needed to learn _vbscript_ and so I startedtackling 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 toremember
methods, parameters, etc, but I know the syntax. That said, if I'mfeeling
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 atleast be able to do simple things in _vbscript_
like read a file, run aexternal 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
Desmondbrian@xxxxxxxxxxxxxxxx> brian@xxxxxxxxxxxxxxxxc
- 312.731.3132_____From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx[mailto:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern, TomSent:
Wednesday, September 21, 2005 4:30 PMTo: ActiveDir@xxxxxxxxxxxxxxxxxxSubject:
RE: [ActiveDir] disabling users I only have time to learn one
scripting lang.i figured perl is the better way to go as i have to
work with linux andsolaris as well.know of any good
docs,books,sites on perl and COM+ or adsi? something that will teach
you both like the _vbscript_ resources do?i really think there
is a market for perl and AD/win32 out there that
isuntapped.O'reilly has let most of their win32 perl books become
outdated and stop at Win NT as has Dave Roth.I'm not a
programmer and i don't have time to learn multipe scripting langs,so i
always thought perl would be the best way to go.I find it as
approachable as _vbscript_ but unlike _vbscript_, I don't find many rescources
for using it on win32 systems.I'm afraid learning perl and working
with windows might be an uphill battle.are there resources for
teaching you how to use perl withcdo,wmi,adsi,ado,etc?i'm not a
total newbie to perl, i've used it on linux but i've never reallydone much
on windows with activestate.and as i've said, i'm not a programmer and
i didn''t major in comp sci, so alot of this stuff is not second nature to
me and hasn't been pounded in for years.so jumping from lang to
lang for me is not really an
option.thanks-----Original
Message-----From: Brian Desmond [mailto:brian@xxxxxxxxxxxxxxxx ]Sent: Wed
9/21/2005 2:46 PMTo: ActiveDir@xxxxxxxxxxxxxxxxxxCc:Subject:
RE: [ActiveDir] disabling
users
kenUser is Offline

Posts:173

09/22/2005 3:09 AM  
Good point¦



Cheers
Ken



From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Brian Desmond
Sent: Thursday, 22 September 2005
11:51 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling
users



If that™s the case you can just pipe the list of DNs into dsmod or
admod.



Thanks,
Brian
Desmond

brian@xxxxxxxxxxxxxxxx



c -
312.731.3132





From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Ken Schaefer
Sent: Wednesday, September 21,
2005 9:37 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling
users



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:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Thursday, 22 September 2005
10:53 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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
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: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx]
On Behalf Of Brian Desmond
Sent: Thursday, 22 September 2005
9:29 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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

brian@xxxxxxxxxxxxxxxx



c -
312.731.3132





From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx]
On Behalf Of Tom Kern
Sent: Wednesday, September 21,
2005 6:56 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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 brian@xxxxxxxxxxxxxxxx>
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
prenoufUser is Offline

Posts:2

09/22/2005 3:44 AM  
To take this another step further, is it required to know how to program? Absolutely not. It is good to know a bit about programming so you can talk with the programmer intelligently, but as an admin it's not required to know how to program. Obviously the more skills you have the better off you are, but don't stress about learning to program if you have other skills to worry about first.


Phil 
On 9/21/05, Tom Kern wrote:

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 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 hasexamples 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 thisfield. 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 andother places. I realized I needed to learn _vbscript_ and so I startedtackling 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 toremember methods, parameters, etc, but I know the syntax. That said, if I'mfeeling 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 atleast be able to do simple things in _vbscript_ like read a file, run aexternal 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 brian@xxxxxxxxxxxxxxxxc - 312.731.3132
_____From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx[mailto:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern, TomSent: Wednesday, September 21, 2005 4:30 PMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: RE: [ActiveDir] disabling users I only have time to learn one scripting lang.i figured perl is the better way to go as i have to work with linux and
solaris as well.know of any good docs,books,sites on perl and COM+ or adsi? something that will teach you both like the _vbscript_ resources do?i really think there is a market for perl and AD/win32 out there that is
untapped.O'reilly has let most of their win32 perl books become outdated and stop at Win NT as has Dave Roth.I'm not a programmer and i don't have time to learn multipe scripting langs,
so i always thought perl would be the best way to go.I find it as approachable as _vbscript_ but unlike _vbscript_, I don't find many rescources for using it on win32 systems.I'm afraid learning perl and working with windows might be an uphill battle.
are there resources for teaching you how to use perl withcdo,wmi,adsi,ado,etc?i'm not a total newbie to perl, i've used it on linux but i've never reallydone much on windows with activestate.
and as i've said, i'm not a programmer and i didn''t major in comp sci, so alot of this stuff is not second nature to me and hasn't been pounded in for years.so jumping from lang to lang for me is not really an option.
thanks-----Original Message-----From: Brian Desmond [mailto:brian@xxxxxxxxxxxxxxxx
]Sent: Wed 9/21/2005 2:46 PMTo: ActiveDir@xxxxxxxxxxxxxxxxxxCc:Subject: RE: [ActiveDir] disabling users
MThommesUser is Offline

Posts:106

09/22/2005 4:01 AM  
Try this:



REM batch file for changing description of
user account based on samaccount name input from a file



for /f %%i in (samaccountname.txt) do dsquery
user -samid %%i | dsmod user -desc "Inactive...Do Not Migrate!"



exit



HTH,

Mike Thommes



-----Original Message-----
From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Thursday, September 22, 2005
4:37 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: Re: [ActiveDir] disabling
users



I never said dn's.



the names are all sAMAccountNames in a csv file.

The consultants from ibm here ran some Quest
tools to determine  which acoounts were inactive and ran that list by HR
to double check.



They can't script either(in fact one guy kept arguing
with me that machines change their passwords every 7 days in win2k NOT 30 days
and wouldn't listen to me. This lis like week 7 of our "migration").

Anyway, now they just want to fill in the description
attrib of the accounts in AD with something like "inactive. Don't
Migrate" so they could filter by that in Quest instead of diabling the
accounts.



so ,to get me started in my perl route, how would one
go about doing that in perl?



Thanks again.

you guys help me out way too much.



sorry...



On 9/22/05, Roger Seielstad roger@xxxxxxxxxxxxxxx> wrote:
Honestly,
I'd avoid perl like the plague. Its about the least readable language on the
planet - especially if you haven't touched a script for a few months.
As was already suggested, python is a pretty good cross platform option.



--------
Roger Seielstad
E-mail Geek







From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On
Behalf Of Tom Kern
Sent: Wednesday, September 21,
2005 3:56 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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 brian@xxxxxxxxxxxxxxxx
> 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

brian@xxxxxxxxxxxxxxxx>
brian@xxxxxxxxxxxxxxxx

c - 312.731.3132

_____

From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern, Tom
Sent: Wednesday, September 21, 2005 4:30 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling users

I only have time to learn one scripting lang.

i figured perl is the better way to go as i have to work with linux and
solaris as well.

know of any good docs,books,sites on perl and COM+ or adsi?

something that will teach you both like the _vbscript_ resources do?

i really think there is a market for perl and AD/win32 out there that is
untapped.

O'reilly has let most of their win32 perl books become outdated and stop at
Win NT as has Dave Roth.

I'm not a programmer and i don't have time to learn multipe scripting langs,
so i always thought perl would be the best way to go.

I find it as approachable as _vbscript_ but unlike _vbscript_, I don't find many
rescources for using it on win32 systems.

I'm afraid learning perl and working with windows might be an uphill battle.

are there resources for teaching you how to use perl with
cdo,wmi,adsi,ado,etc?

i'm not a total newbie to perl, i've used it on linux but i've never really
done much on windows with activestate.

and as i've said, i'm not a programmer and i didn''t major in comp sci, so a
lot of this stuff is not second nature to me and hasn't been pounded in for
years.

so jumping from lang to lang for me is not really an option.

thanks

-----Original Message-----
From: Brian Desmond [mailto:brian@xxxxxxxxxxxxxxxx
]
Sent: Wed 9/21/2005 2:46 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Cc:
Subject: RE: [ActiveDir] disabling users
lvega@xxxx.yyy

09/22/2005 4:15 AM  
Any programmer can write code that
a computer can understand.  Professionals write code that other
programmers can understand.

(From MSDN Code Camp Speaker Les Smith™s
presentation on Refactoring code)





From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of joe
Sent: Thursday, September 22, 2005
10:10 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling
users



Any language can be done in a write once,
read never format. Readabilty is a function of the person writing the code, the
language can only help you accomplish what you are trying to do and are capable
of. If I saw code that was tough to read, in any language, I stick the blame
firmly with the person who wrote it, where it belongs. I have run into
situations where I have seen thousands of lines of _vbscript_ that I simply threw
away because the logic couldn't be followed due to how the script was written,
generally I replaced it with hundreds of lines of clearly written perl that
anyone could read. If you write perl well, it can be nearly self documenting.
But that isn't enough, you still comment the code to explain intent and what
the purpose of different things is.



If I had to argue for a least
readable language, I would argue for cmd batch, but again, it is about the
person writing the code, not the language the code is written in. I have even
seen ASM that was written so cleanly and well with comments that anyone could
follow it.



I think the problem a lot of people have
with perl is its flexibility. TIMTOWTDI. It is the core design of the language,
a loop can be done in many different ways instead of 1 or 2 ways that someone
may be used to seeing. For some people, giving flexibility to them is like
giving them a longer and longer rope to hang themselves.



As I once read in one of the books or
heard from a friend or something... Perl is like playing the guitar, you can
usually do something pretty quickly, but the really cool stuff will take
practice. But on the positive side, it is possible to do the really cool stuff
and usually in a way that makes you feel good.



I just had a bit of a conversation with
one of the Exchange Dev folks who was saying that with Monad, if I want to get
some piece of info about a mailbox from an Exchange 12 server I have to
return all of the info from the server and then filter out what I don't want to
use. The reason given was that is the Monad way... I visualize that like trying
to output whenChanged of an object and having to pull all attributes of the
object to do so. There is a tremendous hit to efficiency if that is the way it
is done. The big thing that scared me though was the comment... that is the
Monad way... What is the way? To assume you have unlimited bandwidth and time
so you can be fat and inefficient?



  joeΏ]







Ώ] Slowly emerging from being way too
submerged in work and other things...





From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Roger Seielstad
Sent: Thursday, September 22, 2005
2:28 AM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling
users

Honestly, I'd avoid perl like the plague.
Its about the least readable language on the planet - especially if you haven't
touched a script for a few months.
As was already suggested, python is a pretty good cross platform option.



--------
Roger Seielstad
E-mail Geek







From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Wednesday, September 21,
2005 3:56 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
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
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
brian@xxxxxxxxxxxxxxxx

c - 312.731.3132

_____

From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto: ActiveDir-owner@xxxxxxxxxxxxxxxxxx]
On Behalf Of Kern, Tom
Sent: Wednesday, September 21, 2005 4:30 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Subject: RE: [ActiveDir] disabling users

I only have time to learn one scripting lang.

i figured perl is the better way to go as i have to work with linux and
solaris as well.

know of any good docs,books,sites on perl and COM+ or adsi?

something that will teach you both like the _vbscript_ resources do?

i really think there is a market for perl and AD/win32 out there that is
untapped.

O'reilly has let most of their win32 perl books become outdated and stop at
Win NT as has Dave Roth.

I'm not a programmer and i don't have time to learn multipe scripting langs,
so i always thought perl would be the best way to go.

I find it as approachable as _vbscript_ but unlike _vbscript_, I don't find many
rescources for using it on win32 systems.

I'm afraid learning perl and working with windows might be an uphill battle.

are there resources for teaching you how to use perl with
cdo,wmi,adsi,ado,etc?

i'm not a total newbie to perl, i've used it on linux but i've never really
done much on windows with activestate.

and as i've said, i'm not a programmer and i didn''t major in comp sci, so a
lot of this stuff is not second nature to me and hasn't been pounded in for
years.

so jumping from lang to lang for me is not really an option.

thanks

-----Original Message-----
From: Brian Desmond [mailto:brian@xxxxxxxxxxxxxxxx
]
Sent: Wed 9/21/2005 2:46 PM
To: ActiveDir@xxxxxxxxxxxxxxxxxx
Cc:
Subject: RE: [ActiveDir] disabling users
listmailUser is Offline

Posts:824

09/22/2005 5:05 AM  
Or simply pipe the SAM names into the
command

net user samaccountname /domain /comment:"Inactive...Do Not
Migrate"



___perl command___

perl -e "foreach () {print `net user $_ /domain
/comment:\\\"Inactive...Do Not Migrate\\\"`};"
samaccountname.txt


From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Thommes, Michael
M.Sent: Thursday, September 22, 2005 11:30 AMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: RE: [ActiveDir] disabling
users
Try
this:

REM batch file for
changing description of user account based on samaccount name input from a
file

for /f %%i in
(samaccountname.txt) do dsquery user -samid %%i | dsmod user -desc
"Inactive...Do Not Migrate!"

exit

HTH,
Mike
Thommes

-----Original
Message-----From:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx]
On Behalf Of Tom KernSent: Thursday, September 22, 2005 4:37
AMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: Re: [ActiveDir] disabling
users


I never said dn's.



the names are all sAMAccountNames in a csv
file.

The consultants from ibm here ran some
Quest tools to determine  which acoounts were inactive and ran that list by
HR to double check.



They can't script either(in fact one guy
kept arguing with me that machines change their passwords every 7 days in win2k
NOT 30 days and wouldn't listen to me. This lis like week 7 of our
"migration").

Anyway, now they just want to fill in the
description attrib of the accounts in AD with something like "inactive. Don't
Migrate" so they could filter by that in Quest instead of diabling the
accounts.



so ,to get me started in my perl route, how
would one go about doing that in perl?



Thanks again.

you guys help me out way too
much.



sorry... 

On 9/22/05, Roger Seielstad roger@xxxxxxxxxxxxxxx>
wrote:
Honestly,
I'd avoid perl like the plague. Its about the least readable language on the
planet - especially if you haven't touched a script for a few months.

As
was already suggested, python is a pretty good cross platform option.

--------Roger
SeielstadE-mail Geek




From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On
Behalf Of Tom KernSent: Wednesday, September 21, 2005 3:56
PMTo: ActiveDir@xxxxxxxxxxxxxxxxxxSubject: 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
brian@xxxxxxxxxxxxxxxx
> 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 hasexamples 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 thisfield. 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 andother places. I realized I needed to learn
_vbscript_ and so I startedtackling 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 toremember methods, parameters, etc, but I know the
syntax. That said, if I'mfeeling 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 atleast be able to do simple
things in _vbscript_ like read a file, run aexternal 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
brian@xxxxxxxxxxxxxxxx> brian@xxxxxxxxxxxxxxxxc -
312.731.3132_____From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx[mailto:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Kern, TomSent:
Wednesday, September 21, 2005 4:30 PMTo: ActiveDir@xxxxxxxxxxxxxxxxxxSubject: RE: [ActiveDir]
disabling users I only have time to learn one scripting
lang.i figured perl is the better way to go as i have to work with linux
andsolaris as well.know of any good docs,books,sites on perl
and COM+ or adsi? something that will teach you both like the _vbscript_
resources do?i really think there is a market for perl and
AD/win32 out there that is untapped.O'reilly has let most of their
win32 perl books become outdated and stop at Win NT as has Dave
Roth.I'm not a programmer and i don't have time to learn multipe
scripting langs,so i always thought perl would be the best way to
go.I find it as approachable as _vbscript_ but unlike _vbscript_, I don't
find many rescources for using it on win32 systems.I'm afraid
learning perl and working with windows might be an uphill battle. are
there resources for teaching you how to use perl
withcdo,wmi,adsi,ado,etc?i'm not a total newbie to perl, i've used
it on linux but i've never reallydone much on windows with
activestate.and as i've said, i'm not a programmer and i didn''t major
in comp sci, so alot of this stuff is not second nature to me and hasn't
been pounded in for years.so jumping from lang to lang for me is not
really an option. thanks-----Original
Message-----From: Brian Desmond [mailto:brian@xxxxxxxxxxxxxxxx
]Sent: Wed 9/21/2005 2:46 PMTo: ActiveDir@xxxxxxxxxxxxxxxxxxCc:Subject: RE:
[ActiveDir] disabling users
You are not authorized to post a reply.
Page 1 of 212 > >>

Forums >ActiveDir Mail List Archive >List Archives > [ActiveDir] disabling users



ActiveForums 3.7
Friends

Friends

VisualClickButoton
Members

Members

MembershipMembership:
Latest New UserLatest:rana.b4523
New TodayNew Today:1
New YesterdayNew Yesterday:1
User CountOverall:5291

People OnlinePeople Online:
VisitorsVisitors:31
MembersMembers:0
TotalTotal:31

Online NowOnline Now:

Ads

Copyright 2012 ActiveDir.org
Terms Of Use