Re: hta front end for script?

From: McKirahan (News_at_McKirahan.com)
Date: 05/11/04


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


"Richard Rekos" <anonymous@discussions.microsoft.com> wrote in message
news:AFD6B11A-9292-4155-870D-7605BB70133C@microsoft.com...
> 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")
> objGroup.PutEx ADS_PROPERTY_APPEND, _
> "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
scripts?".

Watch for word-wrap:

<html>
<hta:Application ID="hta"
     ApplicationName="Account">
<head>
<title>Account.hta</title>
<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")
        objGroup.SetInfo
    Set objGroup = Nothing
End Function
</script>
</head>
<body>
<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()">
</form>
</body>
</html>

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 ...
    (microsoft.public.scripting.vbscript)
  • 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. ...
    (microsoft.public.windows.server.scripting)
  • 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 ...
    (microsoft.public.frontpage.programming)
  • 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 ...
    (microsoft.public.scripting.vbscript)
  • 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. ...
    (microsoft.public.scripting.vbscript)