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

  • From: Steve Snyder <kwajalein@xxxxxxxxx>
  • To: thin@xxxxxxxxxxxxx
  • Date: Wed, 3 Aug 2011 13:19:27 +0200

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
> samAccountName
> 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
> script.
> Jeremy? Warren? Anyone?

Other related posts: