Link to home
Start Free TrialLog in
Avatar of Manfredtoo
ManfredtooFlag for Singapore

asked on

Input box being prompt to add domain users into Local administrator group using VBScript

Hi Experts
I need some help to add a domain user into local administrator group while being prompted to key in a domain user into the input box using vbscript.
cheers
Avatar of William Elliott
William Elliott
Flag of United States of America image


strComputer = "mycomputername"
strPeople = inputbox("what userid?",,"domain\userid")
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://" & strPeople)

Open in new window

Avatar of Manfredtoo

ASKER

weellio: hiya thanks for yr fast responds, but it seems like not working. it didnt pop out any error message.
Does the user who is running this script have admin credentials?

regards
Chandru
chandru: hiya i am using an account with admin credentials. but its still working
ASKER CERTIFIED SOLUTION
Avatar of chandru_sol
chandru_sol
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Manfredtoo!