I have spent the past hour trying to modify a VBScript / JavaScript utility to print out my password expiration date and it is driving me a little crazy. I cannot understand why something that should be so simple can be so blasted difficult. I have several account at client sites and the password expires periodically. In order to make sure I don't let the account lapse, I wanted to print the password expiration date. I had a version that worked before but the distinguishedName had to be exact. I used the adfind utility to figure out my distinguished name and put it in the script. Today I wanted to remove that limitation but it is proving to be a big waste of time. Every attempt to make this work with either VBScript or JavaScript has been thwarted with malice.

Of couse that doesn't stop me from trying -- oh no! Merely a flesh wound. As a programmer determined to make things work, it will bug me until it actually does work! There is silliness involved such as this code to convert an Integer64 to a useable native data type in VBScript:

numDays = CCur((maxPwdAge.HighPart * 2 ^ 32) + _
                maxPwdAge.LowPart) / CCur(-864000000000)

whenPasswordExpires = DateAdd("d", numDays, oUser.PasswordLastChanged)

JavaScript doesn't have the CCur function so I have to use an alternative (and talk about silly -- using a currency data type to do this!). With both VBScript and JavaScript, I am having trouble searching Active Directory with a query or filter. At this point, I may use C# script where I have full .NET power.

C by DissectionThis brings me to the point of this entry. Much of the programming technologies in use are destined for a short lifetime. It is an utter waste to invest time, money, and effort to build complex solutions against technologies and frameworks that will be replaced in two years. It is the dilemma that we find ourselves in though, and sometimes there is no or little choice.

As I write this entry I am looking at the waste land of books including my original C programming textbook from university, a ancient graphics programming book that describes "Mode X", some COM and ATL books, and tucked away somewhere I have the Petzold Win95 book and Prosise MFC Win95 book. Then I start thinking about l-values and r-values, some of the ridiculous MFC hacks I've had to make in the past and I'm glad I don't have to deal with that much anymore. Things have improved especially in the area of dynamic or scripting languages where the power of these languages allow the programmer to accomplish a significant amount of work with less effort. One of the benefits is that is almost forces other languages to add features and streamline for greater efficiency. Unfortunately it is a slow process but I do see progress.