Script will remove the users from Local Administrators group except which are stated in script.Username must be in CAPITAL letter.
Script
Option Explicit
Dim network, group, user
Set network = CreateObject("WScript.Network")
Set group = GetObject("WinNT://" & network.ComputerName & "/Administrators,group")
For Each user In group.members
If UCase(user.name) <> "user1" And UCase(user.name) <> "user2" And UCase(user.name) <> "user3" And UCase(user.name) <> "user4" And UCase(user.name) <> "user5" And UCase(user.name) <> "user6" Then
group.remove user.adspath
End If
Next
Monday, February 7, 2011
Remove From Local Administrators VBS Script
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment