joeware - never stop exploring... :)

Information about joeware mixed with wild and crazy opinions...

4/28/2008

Using AdFind and AdMod for an action you might normally have to script…

by @ 11:29 pm. Filed under tech

I received the following email:

If I wanted to copy the IP Phone attribute of each user into Exchange Extension attribute13 for that user, would AdMod work?  and if so, can you point me to and example?

This is actually extremely easy with adfind and admod since I added the -adcsv capability… This is however where you have to use the “special” formatting protocols in AdMod to describe what you want. This is what my friend Laura Hunter (Shutup Laura) calls the perl like syntax for doing things… There is a definite hint of perl with the {{ and }} but it isn’t perl. I just needed something handy to point out things that needed to be replaced.

So anyway, here is initial output of adfind trying to show the values

G:\>adfind -default -f “&(objectcategory=person)(objectclass=user)(ipphone=*)” ipphone extensionattribute13

AdFind V01.37.00cpp Joe Richards (joe@joeware.net) June 2007

Using server: dc2.joeware.local:389
Directory: Windows Server 2003

dn:CN=testuser,CN=Users,DC=joeware,DC=local
>ipPhone: testipphone
>extensionAttribute13: somevalue

dn:CN=testuser2,CN=Users,DC=joeware,DC=local
>ipPhone: testipphone2

2 Objects returned

 

As you can see, one already has a value in the extensionAttribute13 and one doesn’t.

Then you run the following command (all one line but it may wrap…) (oh and don’t mind the ##BETA## in there, that is my personal version of admod that has bugs in it…

G:\>adfind -default -f “&(objectcategory=person)(objectclass=user)(ipphone=*)” ipphone -adcsv |admod -unsafe extensionattribute13::{{ipphone}}

AdMod V01.11.00cpp ##BETA## Joe Richards (joe@joeware.net) June 2007

DN Count: 2
Using server: dc2.joeware.local:389
Directory: Windows Server 2003

Modifying specified objects…
   DN: CN=testuser,CN=Users,DC=joeware,DC=local…
   DN: CN=testuser2,CN=Users,DC=joeware,DC=local…

The command completed successfully

 

Now if I rerun the show the info command again…

G:\>adfind -default -f “&(objectcategory=person)(objectclass=user)(ipphone=*)” ipphone extensionattribute13

AdFind V01.37.00cpp Joe Richards (joe@joeware.net) June 2007

Using server: dc2.joeware.local:389
Directory: Windows Server 2003

dn:CN=testuser,CN=Users,DC=joeware,DC=local
>ipPhone: testipphone
>extensionAttribute13: testipphone

dn:CN=testuser2,CN=Users,DC=joeware,DC=local
>ipPhone: testipphone2
>extensionAttribute13: testipphone2

2 Objects returned

 

Very nice huh? Previously, that would have taken a script. Granted it would be a simple script but how nice is it to not have to write a script for something so silly?

The command uses AdFind to output a CSV file with the DN and iPPhone values and then AdMod scoops that up and writes the value in the iPPhone column for each object into the extensionAttribute13 attribute. Normally with AdMod if you want to set a value you specify

attribute::value

Since we are pulling data from the CSV file to insert, you tell it to grab that field and I have that set up to do that when AdMod encounters {{attribute}} like

attribute::{{attribute from CSV File}}

If you want to populate the same attribute name with that field from the CSV file… for instance you need to set the displayName of an object to the displayName value in the CSV file you can use this shortcut {{.}} to specify the displayName value from the CSV file… like so

attribute::{{.}}

I didn’t like typing displayname::{{displayname}} as much as the next person and figured, there should be a shortcut there…

You can also do manipulates of the data like merging it with other info, slapping two attributes together (say first and last name), bitwise operations, search and replace… See the CSV help in AdMod to see the manipulations possible… Just type

admod /csv?

or look at http://www.joeware.net/freetools/tools/admod/usage.htm

 

    joe

Rating 3.00 out of 5

Child of the Universe…

by @ 6:16 pm. Filed under quotes

You are a child of the universe
no less than the trees and stars;
you have a right to be here.

Go placidly amid the noise and haste,
and remember what peace
there may be in silence.

As far as possible, without surrender,
be on good terms with all persons.
Speak your truth quietly, and clearly;
and listen to others,
even the dull and ignorant;
they too have their story.

Avoid loud and aggressive persons;
they are vexations to the spirit.

If you compare yourself with others,
you may become vain and bitter,
for always there will be greater
and lesser persons than yourself.

You are a child of the universe
no less than the trees and the stars;
you have a right to be here.
And whether or not it is clear to you,
no doubt the universe
is unfolding as it should.

Enjoy your achievements
as well as your plans.
Keep interested in your own career,
however humble;
it is a real possession
in the changing fortunes of time.
Exercise caution in your business affairs,
for the world is full of trickery.

But let this not blind you
to what virtue there is;
many persons strive for high ideals,
and everywhere life is full of heroism.
Be yourself.

Especially do not feign affection.
Neither be cynical about love,
for in the face
of all aridity and disenchantment,
it is as perennial as the grass.

Take kindly the counsel of the years,
gracefully surrendering the things of youth.
Nurture strength of spirit
to shield you in sudden misfortune.
But do not distress yourself with imaginings.
Many fears are born of fatigue and lonliness.
Beyond a wholesome discipline,
be gentle with yourself.

You are a child of the universe
no less than the trees and the stars;
you have a right to be here.
And whether or not it is clear to you,
no doubt the universe
is unfolding as it should.

Therefore be at peace with God,
whatever you conceive Him to be.
And whatever your labors and aspirations,
in the noisy confusion of life,
keep peace with your soul.
With all its sham, drudgery,
and broken dreams,
it is still a beautiful world.
Be careful.
Strive to be happy.

You are a child of the universe
no less than the trees and the stars;
you have a right to be here.

    – Max Ehrmann 1927

Rating 3.00 out of 5

Useless…

by @ 6:16 pm. Filed under quotes

A DNS server that is dynamically handed its address is NOT the most useful device you could have on a network…

   – Me (in a post to activedir.org)

Rating 3.00 out of 5

4/26/2008

DO-OVER…

by @ 10:52 am. Filed under humour

agnosticreincarnation

Rating 3.00 out of 5

4/25/2008

Darwin Award Wannabee…

by @ 1:47 am. Filed under humour

Two California Highway Patrol Officers were conducting speeding enforcement on I-15, North of MCAS Miramar. One of the officers was using a hand held radar device to check speeding vehicles approaching near the crest of a hill.

The officers were suddenly surprised when the radar gun began reading 300 miles per hour. The officer attempted to reset the radar gun, but it would not reset and turned off.

Just then a deafening roar over the treetops revealed that the radar had in fact locked onto a USMC F/A-18 Hornet which was engaged in a low flying exercise near the location.

Back at the CHP Headquarters the Patrol Captain fired off a complaint to the USMC Base Commander.

Back came a reply in true USMC style:

Thank you for the message, which allows us to complete the file on this Incident. You may be interested to know that the tactical computer in the Hornet had detected the presence of, and subsequently locked onto your hostile radar equipment and automatically sent a jamming signal back to it. Furthermore, an air to ground missile aboard the fully armed aircraft had also automatically locked onto your equipment. Fortunately the Marine Pilot flying the Hornet recognized the situation for what it was, quickly responded to the missile system alert status and was able to override the automated defense system before the missile was launched and your hostile radar was destroyed.

Thank you for your concerns.

Rating 3.00 out of 5

Bidirectional Baby…

by @ 1:42 am. Filed under quotes

Tracers work both ways.

   – U.S. Army Ordnance Manual

Rating 3.00 out of 5

Good Advice…

by @ 1:41 am. Filed under quotes

It is generally inadvisable to eject directly over the area you just bombed.

     – U.S. Air Force Survival Manual

Rating 3.00 out of 5

Uhhhhhh…

by @ 1:40 am. Filed under quotes

If the enemy is in range…. so are you.

   – Infantry Journal

Rating 3.00 out of 5

Friday Chuckle

by @ 1:35 am. Filed under humour

Rating 3.00 out of 5

Why I don’t Like Verizon

by @ 12:51 am. Filed under general

Recently my work cell phone died and I had to get another one, instead of just getting a new phone on the current service (ATT then Cingular then ATT again), I decided to try Verizon as I heard good things about its connectivity.

I am absolutely willing to admit that I was stupid, I should have looked into it more. Alternately when I received it I should have returned it immediately.

Verizon is set up in such a way that you can’t use SIM cards which means you can’t buy an unlocked phone (which are becoming more and more available) and use it with their service. This is sad because I have multiple unlocked Sony Ericsson phones that I adore. When I questioned the “tech” at Verizon about it he was absolutely floored that switching SIMs between phones so you could use different phones without the Service Provider’s approval was even possible…

Anyway, it is something about CDMA versus GSM or some such network nonsense that honestly and truly I really do not have the time nor inclination to care about. I just want a phone service that works and not be bound and gagged by that service provider.

What does this mean… It means that I will be telling everyone I know to stay away from them.

Can ya hear me now?

Rating 3.00 out of 5

[joeware – never stop exploring… :) is proudly powered by WordPress.]