Add domain group to local group 
Author Message
 Add domain group to local group

I have a script to add a domain group in W2K AD to the local administrators
group on W2K Pro workstations. I have followed the sdk for adsi but several
things don't work:
Binding to "WinNT://ComputerName/Administrators" works, but
"WinNT://ComputerName, computer" and "WinNT://Administrators, localgroup"
don't work. The additional parameter specifying the type of object does not
seem to be recognised.
When I add the group I get the error "invalid Active Directory path", even
though I have echoed the path and enumerated the members, so clearly it is a
valid path.
What's the problem?
Thanks,
Anthony
----------------------
set oIadsLocal = GetObject("WinNT://" & strComputer & "/Administrators")
 wscript.echo "The local group is of class: " & oIadsLocal.class
 set
oIadsDomain=GetObject("LDAP://domainname/cn=mygroup,ou=groups,dc=childdomain
,dc=rootdomain,dc=zone,dc=net")
 wscript.echo oIadsDomain.class
 for each member in oIadsDomain.members
   wscript.echo oIadsDomain.name & " Member " & member.name
 next
 wscript.echo oIadsDomain.AdsPath
 oIadsLocal.Add (oIadsDomain.AdsPath)


Sat, 30 Oct 2004 21:11:15 GMT  
 Add domain group to local group
Why would you want to do this?  If your using AD then use Domain Local
groups.

Quote:
> I have a script to add a domain group in W2K AD to the local
administrators
> group on W2K Pro workstations. I have followed the sdk for adsi but
several
> things don't work:
> Binding to "WinNT://ComputerName/Administrators" works, but
> "WinNT://ComputerName, computer" and "WinNT://Administrators, localgroup"
> don't work. The additional parameter specifying the type of object does
not
> seem to be recognised.
> When I add the group I get the error "invalid Active Directory path", even
> though I have echoed the path and enumerated the members, so clearly it is
a
> valid path.
> What's the problem?
> Thanks,
> Anthony
> ----------------------
> set oIadsLocal = GetObject("WinNT://" & strComputer & "/Administrators")
>  wscript.echo "The local group is of class: " & oIadsLocal.class
>  set

oIadsDomain=GetObject("LDAP://domainname/cn=mygroup,ou=groups,dc=childdomain

- Show quoted text -

Quote:
> ,dc=rootdomain,dc=zone,dc=net")
>  wscript.echo oIadsDomain.class
>  for each member in oIadsDomain.members
>    wscript.echo oIadsDomain.name & " Member " & member.name
>  next
>  wscript.echo oIadsDomain.AdsPath
>  oIadsLocal.Add (oIadsDomain.AdsPath)



Tue, 07 Dec 2004 09:11:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help Adding a Domain group to a Local Group

2. Adding domain groups to gthe local administrator group

3. Adding a Domain Global group to a machine local group in Windows 2000

4. Adding a domain group to local administrators group

5. How do I add a domain global-groups in a member-server local group

6. VB script: adding AD group to local administrators group

7. Adding multiple users or groups to local groups

8. Add Global group to Local Group

9. Add Domain Users Group to Powe Users Group in Script

10. Add a domain group to local machine

11. How can I add a Domain Account to the Local Administrators Group

12. Add a domain group to local machine

 

 
Powered by phpBB® Forum Software