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: RE: [ActiveDir] scripting languages - was admod | adfind - rest sAMAccountName case
Prev Next
You are not authorized to post a reply.

AuthorMessages
listmailUser is Offline

Posts:752

01/09/2009 4:15 AM  
I like to think of perl as like learning to play the guitar. It doesn't take
much work to get something that sounds like a song but to be amazing you
have to work your butt off. The thing is, most people don't need to be
amazing guitar players or scripters, just have to do enough to get the
chicks excited (heh - maybe I went too far with that one LOL). Seriously,
having perl installed is a good start. Next step is the same as it is with
learning any language, when you have to do something, try using the language
and see where you get. I have converted many many many people to perl over
the years. One guy I used to work with back in the 90's was a diehard
vbscript guy and now for the last 7 or so years his whole job has been about
writing perl code.

Anyway, perl is free, it is an alternative, it works on darn near every
platform out there and doesn't need to be compiled though it can be compiled
to native code if needed. Tons of examples out there for various things. I
started writing perl back in the mid 90's because a very good friend of mine
(and coworker at the time) asked me for some help on some web stuff she was
doing. At the time I was a hard core REXX and vbscript scripter with a touch
of jscript. After helping her one day I was hooked and never looked back. So
if anyone here knows Christine Fend (Temske) at Covisint/Compuware, you can
give her a shout out from me and tell her I said hi. :)

I would have to disagree on the verbosity of vbscript approaching COBOL... I
used to write quite a bit of COBOL years ago. On the positive side, you
could have a template file and for small programs that would be about 90% of
the code. But I do agree that vbscript is overly verbose for what it does.

For people just getting into scripting and if they don't intend to wander
from MSFT or they absolutely have to deal with Exchange, PowerShell is
probably the right answer although I don't think all that highly of it due
to its .NET requirements. Just not a fan of .NET even still. Ask me again in
5 years and if MSFT sticks with it and keeps going in the current direction
and it matures and .NET is on every Windows machine running maybe I will be
ok with it. Unfortunately though, right now, this is pretty much the only
way to go for some Windows scripting like the Exchange stuff which for many
doesn't make it the right answer, it makes it the only answer.

I may put out a couple of quick utilities that could replace the little perl
script as well, pipeable uc and lc commands.

joe

--
O'Reilly Active Directory Fourth Edition -
http://www.joeware.net/win/ad4e.htm


-----Original Message-----
From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Paul Bergson
(ALLETE)
Sent: Thursday, January 08, 2009 5:11 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] admod | adfind - rest sAMAccountName case

"Of course this presupposes that you have perl loaded and if you don't???
Why not?"

I do, but... alas (joe giving me the evil eye) I am very inept with perl. I
usually do j and vb scripting, so I will probably figure out how to do in
powershell (quests snapin). I'm tired of vb, a real pain in the neck to get
anything done and extremely verbose, almost feels like I'm back in the good
old cobol days. Yes I actually met grace hopper. How many folks in this
board even know who she is without doing a live.com search?

I will watch for your next release since admod is a great tool and
appreciate the access to your tools skills and your technical feedback!


Thanks

Paul


-----Original Message-----
From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: Wednesday, January 07, 2009 5:01 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] admod | adfind - rest sAMAccountName case

When I looked at this post I was like, of course that should work....

Then I looked at my help and was like, wheretf are my upper/lowercase
options? Then I thought, god I must not have documented them. Then I looked
in the source and saw I didn't actually write them into the program...
WTF
was I thinking or not thinking? Paul, I am seriously sorry they aren't in
there because they really should be. Stupid omission on my part, it will be
corrected in the next version of AdMod.

In the meanwhile you could do something like

1. Create the following perl script (intentionally verbose)

# -----------------------------------------------
#Perl Script - UC.pl
while ($line=<STDIN>;) {print uc($line)}; #
-----------------------------------------------

2. Take the command you thought would work of adfind something | admod
something and insert perl uc.pl between them...

Ex:

adfind someswitches | perl uc.pl | admod someswitches


So maybe something like (all one line)


adfind -default -f "&(objectcategory=person)(samaccountname=*)"
samaccountname -adcsv | perl uc.pl | admod samaccountname::{{.}} -unsafe


If you need to switch to lowercase then you need a lc.pl which would look
something like # -----------------------------------------------
#Perl Script - lc.pl
while ($line=<STDIN>;) {print lc($line)}; #
-----------------------------------------------



Of course this presupposes that you have perl loaded and if you don't???
Why
not?


I am actually embarrassed I didn't have a case modifier switch in AdMod for
this... Stupid stupid stupid omission. :(



joe



--
O'Reilly Active Directory Fourth Edition -
http://www.joeware.net/win/ad4e.htm


-----Original Message-----
From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Paul Bergson
(ALLETE)
Sent: Wednesday, January 07, 2009 1:12 PM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] admod | adfind - rest sAMAccountName case

I have just been tasked with doing a case adjustment on the sAMAccountName
because a piece of junk software is case sensitive on it.
I was thinking through using adfind | admod but can't come up with a way to
do this.

I had hoped of using {{sAMAccountName:_lc}} as a piped value from adfind but
don't believe this will work. I am not skilled enough and still trying to
come up with a quick and dirty way to do this.

Anyone have any thoughts?

I saw the other admod | adfind conversation pop up so I thought it would be
on everyone's mind.

Thanks

Paul

List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx

List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx
List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx

List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx
You are not authorized to post a reply.
Forums >ActiveDir Mail List Archive >List Archives > RE: [ActiveDir] scripting languages - was admod | adfind - rest sAMAccountName case



ActiveForums 3.7
Friends

Friends

VisualClickButoton
Members

Members

MembershipMembership:
Latest New UserLatest:janders14
New TodayNew Today:0
New YesterdayNew Yesterday:0
User CountOverall:4825

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

Online NowOnline Now:

Ads

Copyright 2009 ActiveDir.org
Terms Of Use