ADSI Global Groups / Local Groups 
Author Message
 ADSI Global Groups / Local Groups

Is there a way to use ADSI to add a global group to a local group.

What I am trying to accomplish is as follows.

A site has 500 Windows NT workstations (NTW) that are members of single
domain.  The IS departments needs to "administrators of the local machines.
All IS people are members of the Domain Global Group "D-ISV".  I want to use
a script to parse a text file of NTW machine names, access the local NTW
SAM, add the global group D-ISV to the local group Administrators.

This script errors....

ComputerName = "PC1"
Set DomainGroup = GetObject("WinNT://DOMAIN/D-ISV")
LocalGroup = "Administrators"
Set GroupObj = GetObject("WinNT://" & ComputerName & "/" & LocalGroup)
GroupObj.Add ("WinNT://" & ComputerName & "/" & DomainGroup)
Set DomainObj = Nothing
Set GroupObj = Nothing

Any help is appreciated...

thanks



Sun, 27 Jan 2002 03:00:00 GMT  
 ADSI Global Groups / Local Groups
Try this

ComputerName = "PC1"
LocalGroup = "Administrators"
GlobalGroupADSPath = "WinNT://DOMAIN/D-ISV"
Set GroupObj = GetObject("WinNT://" & ComputerName & "/" & LocalGroup)
GroupObj.Add(GlobalGroupADSPath)
Set GroupObj = Nothing

Clarence

http://cwashington.netreach.net

On THIS site you will find everything you need to get up and running. A
script repository with over 250 FREE sample scripts, a downloads section
with FREE COM objects for scripting, a library of reference materials and a
online discussion lounge to provide community based technical support. Check
it out.

Quote:
> Is there a way to use ADSI to add a global group to a local group.

> What I am trying to accomplish is as follows.

> A site has 500 Windows NT workstations (NTW) that are members of single
> domain.  The IS departments needs to "administrators of the local
machines.
> All IS people are members of the Domain Global Group "D-ISV".  I want to
use
> a script to parse a text file of NTW machine names, access the local NTW
> SAM, add the global group D-ISV to the local group Administrators.

> This script errors....

> ComputerName = "PC1"
> Set DomainGroup = GetObject("WinNT://DOMAIN/D-ISV")
> LocalGroup = "Administrators"
> Set GroupObj = GetObject("WinNT://" & ComputerName & "/" & LocalGroup)
> GroupObj.Add ("WinNT://" & ComputerName & "/" & DomainGroup)
> Set DomainObj = Nothing
> Set GroupObj = Nothing

> Any help is appreciated...

> thanks



Sun, 27 Jan 2002 03:00:00 GMT  
 ADSI Global Groups / Local Groups
Thanks....

That worked out....

I suppose I was passing an object and ADSI wanted only the path to an object



Quote:
> Try this

> ComputerName = "PC1"
> LocalGroup = "Administrators"
> GlobalGroupADSPath = "WinNT://DOMAIN/D-ISV"
> Set GroupObj = GetObject("WinNT://" & ComputerName & "/" & LocalGroup)
> GroupObj.Add(GlobalGroupADSPath)
> Set GroupObj = Nothing

> Clarence

> http://cwashington.netreach.net

> On THIS site you will find everything you need to get up and running. A
> script repository with over 250 FREE sample scripts, a downloads section
> with FREE COM objects for scripting, a library of reference materials and
a
> online discussion lounge to provide community based technical support.
Check
> it out.


> > Is there a way to use ADSI to add a global group to a local group.

> > What I am trying to accomplish is as follows.

> > A site has 500 Windows NT workstations (NTW) that are members of single
> > domain.  The IS departments needs to "administrators of the local
> machines.
> > All IS people are members of the Domain Global Group "D-ISV".  I want to
> use
> > a script to parse a text file of NTW machine names, access the local NTW
> > SAM, add the global group D-ISV to the local group Administrators.

> > This script errors....

> > ComputerName = "PC1"
> > Set DomainGroup = GetObject("WinNT://DOMAIN/D-ISV")
> > LocalGroup = "Administrators"
> > Set GroupObj = GetObject("WinNT://" & ComputerName & "/" & LocalGroup)
> > GroupObj.Add ("WinNT://" & ComputerName & "/" & DomainGroup)
> > Set DomainObj = Nothing
> > Set GroupObj = Nothing

> > Any help is appreciated...

> > thanks



Mon, 28 Jan 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

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

2. Add Global group to Local Group

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

4. Enumerating Global groups inside of Universal groups

5. Global & local groups Ismember

6. Adding Global into Local Groups

7. Determining whether a local or global group exists via script

8. Create local and global-Group in AD

9. help Adding a Domain group to a Local Group

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

11. Adding multiple users or groups to local groups

12. Add domain group to local group

 

 
Powered by phpBB® Forum Software