
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=childdomai
n
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)