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

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