vbscript to delete multiple specific local user accounts from servers
Hi,
i am trying to write a vbscript to delete specific user account from server.
If in server found the users adm,ame the script should delete and also it should print the result whether the deletion is successful or not. Below is the script which I tried writing and I am getting an error . Can anyone help me to correct this ?
Dim disuser, objNetwork, strComputer, objComputer
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set objComputer = GetObject("WinNT://" & strComputer)
On Error Resume Next
For each disuser In "adm ame"
Call objComputer.Delete("user", disuser)
On Error GoTo 0
Next
'On Error res="fail"
1 Comment
[ + ] Show comment
-
I use a free program called delprof2 for this task. - flip1001 8 years ago
Answers (1)
Please log in to answer
Posted by:
anonymous_9363
8 years ago