Link to home
Start Free TrialLog in
Avatar of pazwant
pazwantFlag for Türkiye

asked on

Delete local groups with SID number

Hi guys,

I have to delete 4 groups on admnistrators tab of 2003 Servers, i can delete 3 of them with their name but the 4 one includes orphaned sid .
The script errors like " the object could not be member .. " do you have any idea how can we delete these groups inludes SID ?  


Const ForReading = 1
Dim ipfile
ipfile = "C:\par\ip_del.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(ipfile, ForReading)

Do Until objTextFile.AtEndOfStream
   strNextLine = objTextFile.Readline
   arrServiceList = Split(strNextLine , ",")  
   
strComputer = arrServiceList(0)

Set objAdmins = GetObject("WinNT://" & strComputer & "/Administrators")
Set objGroup.Name= "S-1-5-21-1757981266-1580436667-1343024091-514"
objAdmins.Remove(objGroup.ADsPath)
Loop
WScript.Echo("all done")
ASKER CERTIFIED SOLUTION
Avatar of Don
Don
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial