[THIN] OT: bit of vbscript/hta scripting help?

  • From: Steve Snyder <kwajalein@xxxxxxxxx>
  • To: thin@xxxxxxxxxxxxx
  • Date: Wed, 3 Aug 2011 12:38:05 +0200

So, got a long messy vbscript that deletes user accounts, their mailboxes,
profiles, life savings, etc. works great.
Slimming it down and stuffing it into HTA for one-off deletions and doesn't
work so hot. I get "80072032 an invalid dn syntax has been specified"

the script:

set UserObj = GetObject("LDAP:// & UserDN)
set objContainer = GetObject(UserObj.Parent)
objContainer.Delete "user","cn=" * UserObj.cn

UserDN is the distinguished name via a function ya'll have probably seen
before that pulls the distinguishedName from an LDAP query on the

If I say bag it and try to just run "net user username /delete /domain" I
get access denied as we're on vista boxes with no quick, easy way to elevate
a HTA file, unless someone knows how to elevate a command from within a

Jeremy? Warren? Anyone?

Other related posts: