删除除需要的管理员之外的管理员用户!

此为VBS脚本,以下的意思是删除 除administrator、Raymond 之外的管理员用户!

strComputer = "."
On Error Resume Next
Set oGroupAdm = GetObject("WinNT://" & strComputer & "/Administrators")
For Each oAdmGrpUser In oGroupAdm.Members
        sAdmGrpUser = LCase(oAdmGrpUser.Name)
        If (sAdmGrpUser <> "administrator") And (sAdmGrpUser <> "domain admins") And (sAdmGrpUser <> "Raymond") Then
                oGroupAdm.Remove oAdmGrpUser.ADsPath
        End if
Next

你可能感兴趣的:(脚本,domain,each)