by Anonymous (267 Submissions)
Category: Windows System Services
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 4th May 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
ADSI sample - removes a computer from a domain by deleting its computer account. Written in VBScript, using ADSI.
' This script removes a computer from a domain by deleting its computer account
' Goto http://www.activexperts.com/activmonitor and click on ADSI Samples
' for more samples
Sub RemoveComputer( strDomain, strComputer )
Dim objDC
Set objDC = getobject("WinNT://" & strDomain )
' objDC.Delete( "Computer", strComputer )
End Sub
' Main
Dim strDomain, strComputer
Do
strDomain = inputbox( "Please enter a domainname", "Input" )
Loop until strDomain <> ""
Do
strComputer = inputbox( "Please the name of the computer to be removed from the domain", "Input" )
Loop until strComputer <> ""
RemoveComputer strDomain, strComputer
WScript.Echo "Done."
WScript.Echo( vbCrlf & "For more samples, goto http://www.activexperts.com/activmonitor and click" )
WScript.Echo( "on ADSI samples" )
No comments have been posted about ADSI sample - removes a computer from a domain by deleting its computer account. Written in VBScrip. Why not be the first to post a comment about ADSI sample - removes a computer from a domain by deleting its computer account. Written in VBScrip.