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

A. The following code will delete the passed computer name (e.g., "deleteme") from the savilltech domain.

Dim objDC
Dim strComputer, strDomain
strComputer = "deleteme"
strDomain = "savilltech"
Set objDC = getobject("WinNT://" & strDomain )
objDC.Delete "Computer", strComputer
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish