Re: hta front end for script?

From: McKirahan (
Date: 05/11/04

Date: Tue, 11 May 2004 13:03:12 GMT

"Richard Rekos" <> wrote in message
> I cannot figure out how to setup a form on a hta page so I can input the
value for "cn" and "ou" (4th line on script below). I am trying to have
this script add a user to a security group in AD. I don't want to have to
go into the code and enter the cn and ou values, I would like to use a form
in a hta page. Can anyone help w/ this? Many thanks.
> Set objGroup = GetObject _
> ("LDAP://cn=testing,ou=qm,dc=xyz,dc=com")
> "member", Array("cn=rich,ou=test,ou=qm,dc=xyz,dc=com")
> objGroup.SetInfo

Richard, just adapt what I gave you before for "Front End input for

Watch for word-wrap:

<hta:Application ID="hta"
<script type="text/vbscript">
Function Account()
    Dim strCN
        strCN = document.form1.CN.value
    Dim strOU
      strOU = document.form1.OU.value
    Dim objGroup
'* the following needs some tweaking ...
    Set objGroup = GetObject("LDAP://cn=testing,ou=qm,dc=xyz,dc=com")
        objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array"cn=" & strCN &
",ou=" & strOU & ",ou=qm,dc=xyz,dc=com")
    Set objGroup = Nothing
End Function
<form name="form1">
<br><b>CN :</b> &nbsp; <input type="text" name="CN"> &nbsp;
<br><b>OU :</b> &nbsp; <input type="text" name="OU"> &nbsp;
<br><input type="button" value="Create Account" onclick="Account()">

Save as "Account.hta" the double-click on it in Windows Explorer.

I'm not familiar with ".PutEx" so I don't understand why "ou=" and "dc="
appear twice and thus my "solution" doesn't correctly do what you want...

Relevant Pages

  • Re: Front End input for scripts?
    ... "Richard Rekos" wrote in message ... script so that I can enter values in a "form" like fashion as opposed to ... Function Account() ... Dim strUser ...
  • Re: How Using the "Select Users, Computer, and Groups" CommonDialo
    ... > Dialogbox within a HTA, but thats not exactly what I thougt. ... > wich opens my desired dialog. ... COM object for use in script. ...
  • Re: WScript.Sleep for HTA?
    ... >> I've got an HTA that does a bunch of database processing ... It's my backup for WSCs, where the calling script fails to ... and not a basic problem with handling the WScript object. ...
  • Re: Fetching META tag data from non-local URL
    ... >> remote site in an IFRAME and then access it in various ways. ... >> scenario) is whether a script in the remote site would be able to access the HTA upward ... single instance of your example (really, what I did was to download it, examine it ...
  • Re: Logon HTA display not updating
    ... I have a HTA script that runs as a logon script. ... I use a textarea to display a timestamped message ... Sub Main ...