Link to home
Start Free TrialLog in
Avatar of TWCMIL
TWCMIL

asked on

Using a form button with VBScript to delete a computer account in Active Directory

I have a VBScript called on a web page to delete a computer from our Active Directory site. The script portion works great in a stand-alone VBS file. But no such luck using this method from a web page though. Any ideas? FYI Permission is not the issue... running both from same machine.


Script Code:
<script language="VBScript">
<!--
Function Submit_OnClick
MsgBox "Delete command was accepted."
strComputer = "TESTCPU1"
Domain = "MIDWEST"

Set objComputer = GetObject("LDAP://CN=" & strComputer & ",CN=Computers,DC=" & Domain & ",DC=com")
objComputer.DeleteObject(0)

End Function
-->
</script>


Button/Form Code
  <form name="frm" method="post">
    <input type="submit" name="Submit" value="Delete from Active Directory">
  </form>
ASKER CERTIFIED SOLUTION
Avatar of wsteegmans
wsteegmans

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TWCMIL
TWCMIL

ASKER

this doesn't do anything...
any other ideas?
Avatar of TWCMIL

ASKER

POINTS INCREASED TO 500 !! !! !!
Avatar of TWCMIL

ASKER

Any luck binding to the ADSI object?