Adds kenmyer to the local Administrators group on a computer named atl-ws-01.

Visual Basic
Edit|Remove
strComputer = "atl-ws-01"
strGroup = "Administrators"
strUser = "kenmyer"
Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup & ",group")
Set objUser = GetObject("WinNT://" & strComputer & "/" & strUser & ",user")
objGroup.Add(objUser.ADsPath)