How can I use a script to delete a computer from a domain?

The following code will delete the passed computer name (e.g., “delme”) from the alibutt domain.

Dim objDC
Dim strComputer, strDomain
strComputer = “delme”
strDomain = “alibutt”
Set objDC = getobject(“WinNT://” & strDomain )
objDC.Delete “Computer”, strComputer

Leave a Reply

Your email address will not be published. Required fields are marked *