in reply to convert VBscript to Perl

I haven't used it personally, but from reading your vbscript code it looks like you could replace it with Net::LDAP.