Advertisement

03.23.2005 at 06:53AM PST, ID: 21361734
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

VB Script to make a group a member in AD

Asked by whiting002 in Visual Basic Programming

Tags: , , , ,

I am currently using a script to create a large number of OUs inside of a domain.  Then the script creates 3 new domain global groups inside each OU.  Can anyone tell me what I need to add to this script in order to make these Domain Global Groups members of a domain local group in the Users folder under the domain.

An example of one of my OUs would be the OU name NOVA.  NOVA would have three groups a NOVAMaintManagers group which needs to be a member of the domain local group MaintManagers in the domain.  A NOVAPower Users group which needs to be a memeber of Power Users.  A NOVAUsers group which needs to be a member of Users.

Here is a copy of my current code:

Dim oFSO, oTS, oADRoot, oADDomain, oADOU, oADGroup, szLine, a_szSuffixes, szSuffix

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oTS = oFSO.OpenTextFile("c:\ScriptOU\test.txt", 1)
Set oADRoot = GetObject("LDAP://rootDSE")
Set oADDomain = GetObject("LDAP://" & oADRoot.Get("defaultNamingContext"))

a_szSuffixes = Array("Users", "MaintManagers", "PowerUsers")

Do Until oTS.AtEndOfStream

   szLine = Trim(oTS.ReadLine)

   Set oADOU = oADDomain.Create("organizationalUnit","ou="& szLine)
      oADOU.Put "Description", szLine
      oADOU.SetInfo

   For Each szSuffix In a_szSuffixes
      Set oADGroup = oADOU.Create("Group", "cn=" & szLine & szSuffix)
          oADGroup.Put "sAMAccountName", szLine & szSuffix & "_AM"
          oADGroup.Put "Description", szLine & szSuffix
          oADGroup.SetInfo
   Next

Loop

oTS.Close

Set oFSO = Nothing
Set oTS = Nothing
Set oADGroup = Nothing
Set oADOU = Nothing
Set oADRoot = Nothing
Set oADDomain = Nothing
Start Free Trial
[+][-]03.23.2005 at 07:15AM PST, ID: 13612249

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: group, ad, create, vb, script
Sign Up Now!
Solution Provided By: jimbobmcgee
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.23.2005 at 07:36AM PST, ID: 13612510

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.23.2005 at 08:02AM PST, ID: 13612821

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.23.2005 at 08:07AM PST, ID: 13612883

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.23.2005 at 08:21AM PST, ID: 13613054

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.23.2005 at 08:40AM PST, ID: 13613275

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.23.2005 at 09:32AM PST, ID: 13613915

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.24.2005 at 03:09AM PST, ID: 13620463

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.24.2005 at 05:38AM PST, ID: 13621491

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32