TryRebooting
MIS
I'm trying to use the following script to delete a computer from a domain. It runs fine, but the computer is still listed in server manager. I cannot access the workstation, but I would like to know why the reference remains. Thanks.
'==========================================================
Sub RemoveComputer(strDomain, strComputer)
Dim objDC
Set objDC = GetObject("WinNT://" & strDomain)
objDC.Delete "Computer", strComputer
End Sub
'
'==========================================================
'Main
'
On Error Resume Next
Dim strDomain, strComputer
strDomain=InputBox("Please Enter A Domain.", "Input")
dtrComputer=Inputbox("Please Enter The Name Of The Computer", "Input")
RemoveComputer strDomain, strComputer
WScript.Echo "Done.
'==========================================================
Sub RemoveComputer(strDomain, strComputer)
Dim objDC
Set objDC = GetObject("WinNT://" & strDomain)
objDC.Delete "Computer", strComputer
End Sub
'
'==========================================================
'Main
'
On Error Resume Next
Dim strDomain, strComputer
strDomain=InputBox("Please Enter A Domain.", "Input")
dtrComputer=Inputbox("Please Enter The Name Of The Computer", "Input")
RemoveComputer strDomain, strComputer
WScript.Echo "Done.