Vbs Script To Remove A Specified Domain User Name From A Remote Machines Local Admins Group

 

This by request Vbs script will allow you to enter a domain and user name and remove them from the local administrators group on the server or workstation specified.

 

Vbs Script:

 

strComputer = InputBox ("Enter Machine Name")

strDomain = InputBox ("Enter Domain Name")

strUser = InputBox ("Enter User Name")

 

Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")

Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser)

 

objGroup.Remove(objUser.ADsPath)

 

MsgBox "Done"

 

Published Saturday, March 24, 2007 10:29 AM by dhite
Filed under:

Comments

No Comments