i am trying to use this script to delete a user named test1 from the local
administrator group. Each time i run it, it came up with errors. Any help to
get thid script running will be greatly appreciated
thanks
below is the script
Option Explicit
Dim src, username
src = "delete.txt"
username = "test1"
cleanAdminGroup src, username
Function cleanAdminGroup(file,username)
Dim network, group, user, fso, temp, ts
Set network = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(file) Then
WScript.Echo "File does not exist: " & file
Else
Set ts = fso.OpenTextFile(file,1)
Do Until ts.AtEndOfStream
temp = ts.ReadLine
Set group = GetObject("WinNT://" & temp & "/Administrators,group")
For Each user In group.members
If UCase(user.name) = UCase(username) Then
group.remove user.adspath
End If
Next
Loop
group.add("WinNT://("ou=laptop,ou=BUTEAU,ou=ADMIN_TEST,dc=tch,dc=edu")
>>move2bccr.log
End If
End Function