![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | add a global group to a domain local group Hello ng I will add a global group to a domain local group with a vb-script. This code doesn't run: Const ADS_PROPERTY_APPEND = 3 Set objGroup = GetObject ("LDAP://CN=DL Anarbeitung - RW,OU=GroupRessource,OU=Groups,OU=ab,DC=xy,DC=local") objGroup.PutEx ADS_PROPERTY_APPEND, "member", _ Array ("LDAP://CN=GG Anarbeitung -RW,OU=GroupGlobal,OU=Groups,OU=ab,DC=xy,DC=local") objGroup.SetInfo The error is: - The server is unwilling to process the request! -> at this command: objGroup.SetInfo Thanks miller |
My System Specs![]() |
| | #2 (permalink) |
| | Re: add a global group to a domain local group "Mick" <mw@xxxxxx> wrote in message news:A53880F1-2427-4B3F-89C1-F4E11C4B02AE@xxxxxx Quote: > Hello ng > > I will add a global group to a domain local group with a vb-script. > > This code doesn't run: > Const ADS_PROPERTY_APPEND = 3 > > Set objGroup = GetObject ("LDAP://CN=DL Anarbeitung - > RW,OU=GroupRessource,OU=Groups,OU=ab,DC=xy,DC=local") > objGroup.PutEx ADS_PROPERTY_APPEND, "member", _ > Array ("LDAP://CN=GG > Anarbeitung -RW,OU=GroupGlobal,OU=Groups,OU=ab,DC=xy,DC=local") > objGroup.SetInfo > > The error is: > - The server is unwilling to process the request! -> at this command: > objGroup.SetInfo > > > > Thanks > miller > of user/group/computer objects (the members). You should not modify these attributes directly. You can use the Add method of the group object to add members (and the Remove method to remove members and the IsMember method to check membership). You pass the AdsPath of the prospective member to the methods. When adding a member, I like to bind to the member object, so I'm sure it exists and I have the correct AdsPath. For example (watch line wrapping): ====== Set objGroup = GetObject ("LDAP://CN=DL Anarbeitung - RW,OU=GroupRessource,OU=Groups,OU=ab,DC=xy,DC=local") Set objMember = GetObject("LDAP://CN=GG Anarbeitung -RW,OU=GroupGlobal,OU=Groups,OU=ab,DC=xy,DC=local") ' Check if already a member. If (objGroup.IsMember(objMember.AdsPath) = False) Then ' Add member to the group. objGroup.Add(objMember.AdsPath) End If ====== I believe it's possible to manipulate the linked attribute memberOf, although I don't recommend it. You cannot manipulate the backlinked attribute member directly. The methods exposed by the IADsGroup interface were designed for the purpose. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: add a global group to a domain local group "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> schrieb im Newsbeitrag news:OcA788oGKHA.4956@xxxxxx Quote: > ====== > Set objGroup = GetObject ("LDAP://CN=DL Anarbeitung - > RW,OU=GroupRessource,OU=Groups,OU=ab,DC=xy,DC=local") > Set objMember = GetObject("LDAP://CN=GG > Anarbeitung -RW,OU=GroupGlobal,OU=Groups,OU=ab,DC=xy,DC=local") > ' Check if already a member. > If (objGroup.IsMember(objMember.AdsPath) = False) Then > ' Add member to the group. > objGroup.Add(objMember.AdsPath) > End If > ====== hello Richard It runs perfect! thanks |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| "add domain group to local group" stopped working | VB Script | |||
| add user to group /group scope - Global /Group type - Security | PowerShell | |||
| Difference between a domain group and a local group | VB Script | |||
| Add domain group to local group question | VB Script | |||
| adding a domain user to the local group | PowerShell | |||