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

  • From: "Jeremy Saunders" <jeremy@xxxxxxxxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Wed, 3 Aug 2011 20:34:16 +0800

You're missing a double quote in the first line after the //


To confirm the value is right, place a line above it like this.

Msgbox "LDAP:// " & UserDN



From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On Behalf
Of Steve Snyder
Sent: Wednesday, 3 August 2011 7:19 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: OT: bit of vbscript/hta scripting help?


ah workaround, this works

objShell.ShellExecute "cmd.exe", "/C net user username /DELETE /DOMAIN:, "",
"runas", 1

Still, if anyone wants to chime in on why the method works as vbs but not
hta, I would be happy to be enlightened on the subject.

On Wed, Aug 3, 2011 at 12:38 PM, Steve Snyder <kwajalein@xxxxxxxxx> wrote:

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: