|
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
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:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Tom Kern Sent: Thursday, September 22, 2005 4:37
AM To:
[email protected] Subject: Re: [ActiveDir] disabling
users
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?
you guys help me out way too
much.
On 9/22/05, Roger Seielstad <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED]] On
Behalf Of Tom Kern Sent: Wednesday, September 21, 2005 3:56
PM To: [email protected] 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?
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
<mailto:
[EMAIL PROTECTED]> [EMAIL PROTECTED]
c -
312.731.3132
_____
From: [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED]] On Behalf Of Kern, Tom Sent:
Wednesday, September 21, 2005 4:30 PM To: [email protected] 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:[EMAIL PROTECTED]
] Sent: Wed 9/21/2005 2:46 PM To: [email protected] Cc: Subject: RE:
[ActiveDir] disabling users
|