Home
Certification Preparation
Microsoft
MCSA / MCSE on Windows 2003 General
Server 70-290
Add User to A local Group (Script)
Ally77
Hey stil studyin for this exam,
trying to get the sample script to work to add a user to the local administrators group in AD. Dont know much about scripting so need help!! The sample script is as follows :
strComputer = "MyComputer"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/kenmyer,user")
objGroup.Add(objUser.ADsPath)
I pasted this into notepad, replaced "MyComputer" with my own computer name (even tried the full computer name) and saved it with the .exe extension but it would not work. Can anyone help me?Iv probably jus done somethin stupid since i dont know scripting
Thanks
Find more posts tagged with
Comments
woodworm
Tried it on my home PC and it worked ok (once I created a KenMyer user!).
It needs to be a .vbs extension
You're a lot better at scripting than me! I couldn't have written that
Ally77
Aaaah i think i see what iv done! Been studyin too much am at the stage of making stupid mistakes. il go try that
Thanks for the reply
Ally77
Cheers
It was just the wrong extension!what was i thinkin .exe instead of .vbs lol. been workin too much lately, gonna give it a break an get
@~"
;"ed tonight. probably do me good!!
Thanks again
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of