Link to home
Start Free TrialLog in
Avatar of kwatt562
kwatt562Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Add PC to AD group with vbs

Hi,
I am preparing a script to rename and join a pc to the domain (specific OU) with a hta and vbs. As a second part to this I would like to auto add the PC to an AD group. However I am struggling to get information on how to add the PC to an AD group (AD group is called Computer_Policy)

Does anyone know how this can be achieved? can find info on adding users but not PC's

thanks
Avatar of remmett70
remmett70
Flag of United States of America image

Have you considered using powershell and active directory cmdlets?

ADD-ADGroupMember will add computers to groups easily.
Avatar of kwatt562

ASKER

Not really, as don't no much about powershell. Will check out though
cool, can they be packaged into a bat file or something so can just be clicked on?
They can be run from a .bat  You would just do something like this

Powershell.exe -executionpolicy remotesigned -File  c:\scripts\script.ps1
awesome thanks, is there a way to do it without having to manually enter the PC name (i.e it takes the name of the PC being run on?
ASKER CERTIFIED SOLUTION
Avatar of remmett70
remmett70
Flag of United States of America 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
that worked, thanks a lot