Translate:          

Tuesday, December 01, 2009

ASP Verify Credentials Against a Domain - IsAuthenticated

A few months ago I ran into a bit of a problem. I was programming a front end for web application, and in that web application I wanted to prompt for the users username and password, and then verify that that user was, in fact, a user in the domain.

I then wanted to pull the user's information, like the DistinguishedName property, and it's CN or CommonName. This was surprisingly hard to figure out. There was lots of information out there on how to do IIS impersonation, which is not what I wanted to do, but I did want to verify the users credentials to see certain information.

After quite a bit o ...

Read More...

Send this to:                          

Tuesday, November 24, 2009

More Really Useful VBScript Array Functions - ArraySort and DoubleArraySort

A while back I wrote an article about VBScript arrays and their various shortcomings entitled "VBScript Array Functions - DeleteFromArray, InArray". I love these functions because they really simplify the manipulation of arrays and directly address some of the obvious flaws with the initial implementation of arrays in VBScript.

At the end of that article, written almost a year ago, I also mention writing sort functions for VBScript. Well I finally go around to it today and decided that these two functions were just way to handy not to share.

The first one, which will probably be the one most commonly used is a simple sort function, where you can sort ascendingly or or descendinglying depending on which value you pass for sOrder. The nice thing about this, is that it will sort your array simply by calling it as a normal sub.

The second sub works exactly like the first one, except that it will sort 2 arrays relationally. For example, lets say you have Array1 and Array2 who's indexes are related. Lets say now you wish to sort Array1 but also maintain the 1:1 relationship you have between Array1 and Array2. This sub will do exactly that by passing Array1 as the first parameter, Array2 as the second parameter and the order, descending or ascending as the final parameter.

I think these are pretty slick and many of you will find them immensely useful in your own scripts and projec ...

Read More...

Send this to:                          

Thursday, August 06, 2009

Yes, this blog is still alive...

Oh hai!Hi guys! It's been a while, huh?

I just wanted to post a quick note and let you guys know that I have not abandoned this blog. I have received a few emails about code or projects wondering if I still check this blog or my email address and the answer is, "Yes!"

I just haven't had any the time or inclination to post anything new. When I get some time or have another great code snippet to share, as usual, I'll be sure to post it up.

If you have an suggestions on a particular project I should tackle, please feel free to let me know. You know how to contact me!

Please keep in mind I'm not going to write a complex script or teach you how to do things that are clearly documented other places. I'll only be considering simple tasks (in VBScript, no I won't do your PHP or whatever other language either) that aren't covered in a concise way somewhere else.

Anyway, thanks for all the nice email and words of support! I'm not gone, I'm here to stay and I'll see you soon! ...

Read More...

Send this to:                          

Monday, November 17, 2008

SQL Server 2005 Database Mirroring Limitations and Gotchas

I have been working pretty extensively with SQL Server Mirroring in Microsoft SQL Server 2005. It seems to work pretty effectively, though setup outside a domain configuration is convoluted to say the least.

I have posted in the past about some problems I have had setting it up. My difficulties with the configuration aspect actually generated KB940254. The writeup for this particular KB seems kind of convoluted but the long and short of it is that you must use the actual machine name and not arbitrary DNS or Host file entries for mirroring configuration.

SQL Sever 2005 Mirroring Gotcha - Expiring Certificates

Well as we have plugged away with more of our clients using SQL Server Mirroring we have approached 2 more interesting issues. The first one is that, by default, when using SQL Server mirroring with certificates for authentication and encryption, SQL server certificates will expire after one year.

After your certificates expire SQL Server Mirroring will fail, rather ungracefully, if either the principal or mirror instance fails for any reason. And, if the server that fails happens to be the principal instance, your whole mirror instance dies and all your mirror databases go offline, the mirror does not recover even if you have configured a witness. ...

Read More...

Send this to:                          

Wednesday, March 05, 2008

Simple XML Tool Written with VBScript in HTA

I don't know how many of you out there have had the pleasure of trying to integrate a website into the Google Checkout API but it's a surprisingly painless process. They have a bunch of sample code that helps to streamline and accelerate the process drastically.

Google has this nice control panel where it tells you what XML it was submitting and what error was returned, which is really handy. Without it, troubleshooting issues would be pretty much impossible. Well during the course of troubleshooting these issues I really needed to test the exact XML that Google was trying to submit to the XML listener I had setup.

Well I did a quick Google and I couldn't find any really simple tools to submit XML to a generic URL and see what kind of response the URL would return. Since this seemed like something a lot of people (well developers anyway) would be doing on a really regular basis I decided to whip up a quick tool to save myself and anyone who felt like using it, a bunch of time.

Since my language of choice for speed and simplicity is obviously VBScript, I decided to whip up an HTA with the appropriate fields and utilize a bunch of stock functions I had already written. This whole thing took about 10 minutes to write and I think works pretty well. I use it all the time to troubleshoot my projects as well as client issues that might pop up.

If you’re not familiar with HTA’s a ...

Read More...

Send this to: