ADSI sample - removes a computer from a domain by deleting its computer account. Written in VBScrip
ADSI sample - removes a computer from a domain by deleting its computer account. Written in VBScript, using ADSI.
Rate ADSI sample - removes a computer from a domain by deleting its computer account. Written in VBScrip
(3(3 Vote))
' 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" )
ADSI sample - removes a computer from a domain by deleting its computer account. Written in VBScrip Comments
No comments yet — be the first to post one!
Post a Comment