SHARE
Facebook X Pinterest WhatsApp

New Groups in AD

Author: Eugenio TalaricoPlatform: Windows Type: VBScript DESCRIPTION: You can use to create multiple groups into OU=GROUPS using this line in a batch file: for /F “tokens=1-2 usebackq delims=;” %%1 in (input.txt) do ( cscript NewGroups.vbs %%1 %%2 //B //Nologo >> err_log.txt 2>>&1 ) The context of the input file is name_of_the_groups;comment Scroll down to view […]

Jun 8, 2004
Datamation content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Author: Eugenio Talarico
Platform: Windows

Type: VBScript

DESCRIPTION: You can use to create multiple groups into OU=GROUPS using this line in a batch file:


for /F "tokens=1-2 usebackq delims=;" %%1 in (input.txt) do ( cscript NewGroups.vbs %%1 %%2 //B //Nologo >> err_log.txt 2>>&1 )

The context of the input file is name_of_the_groups;comment

Scroll down to view the script.


''****************************************************************************
''*
''* Create a new groups in an Active Directory Infrastructure
''*
''* Created By Eugenio Talarico - 10/12/2003
''*
''****************************************************************************
''* THe sintax you have to use to run the script is
''* cscript newgroups.vbs NAME_OF_THE_GROUPS 
''* Name_of_the_groups rappresent the groups you need to create
''*****************************************************************************
''*****************************************************************************
''* INTO STRVARIABL LINE PUT THE PATH WHERE THE GROUPS 
''* WILL CREATED (EX: strVariabl = ",OU=Standard Users,OU=DomainNAME,")
''*****************************************************************************
''*****************************************************************************
strVariabl = "OU=groups"
''*****************************************************************************
''*****************************************************************************
''*****************************************************************************
''**Start Encode**

dim nome
dim Commento
ParseCommandLine()
wscript.echo nome


Const ADS_PROPERTY_APPEND = 3 
Set objRootDSE = GetObject("LDAP://rootDSE")

strFissa = strVariabl & "," & objRootDSE.Get("defaultNamingContext")
wscript.echo strFissa

Set objGroup = GetObject _
("LDAP://"& strFissa)

Set objGroup = objGroup.Create ("group", "CN=" & nome)
objGroup.Put "sAMAccountName", nome
ObjGroup.Put "Description", commento
objGroup.SetInfo

Sub ParseCommandLine()
Dim vArgs

set vArgs = WScript.Arguments

if vArgs.Count  2 then 
DisplayUsage()
Else
nome = vArgs(0)
commento = vArgs(1)
End if
End Sub

Disclaimer: We hope that the information in these pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided “as – is”, without any warranty, whether express or implied, of its accuracy,
completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by me. I shall not be liable for any damages you
may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

  SEE ALL
APPLICATIONS ARTICLES
 

Recommended for you...

8 Best Data Analytics Tools: Gain Data-Driven Advantage
Common Data Visualization Examples: Transform Numbers into Narratives
Liz Ticong
May 20, 2024
10 Best Cloud-Based Project Management Software Platforms of 2024
Leon Yen
May 14, 2024
HubSpot CRM vs. Salesforce: Head-To-Head Comparison (2024)
Datamation Logo

Datamation is the leading industry resource for B2B data professionals and technology buyers. Datamation's focus is on providing insight into the latest trends and innovation in AI, data security, big data, and more, along with in-depth product recommendations and comparisons. More than 1.7M users gain insight and guidance from Datamation every year.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.