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>
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
POINTS INCREASED TO 500 !! !! !!
ASKER
Any luck binding to the ADSI object?
ASKER
any other ideas?