?
Solved

Create multiple groups in Powershell

Posted on 2014-10-03
2
Medium Priority
?
318 Views
Last Modified: 2014-10-29
Hi- I need a simple powershell script to create multiple global security groups.
0
Comment
Question by:LazaroB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
becraig earned 2000 total points
ID: 40360666
If you have a list of names in a text/csv file and the corresponding target OU:

import-csv file.csv | % {
NEW-ADGroup –name $_.Name –groupscope Global –path $_.OU
}

Open in new window


This is with the idea of you have a comma separated file as below

Name, OU
acctgroup, "OU-path"
mktgroup, "OU-Path"
0
 

Author Closing Comment

by:LazaroB
ID: 40410854
Thank you.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A hard and fast method for reducing Active Directory Administrators members.
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question