Solved

Create multiple groups in Powershell

Posted on 2014-10-03
2
221 Views
Last Modified: 2014-10-29
Hi- I need a simple powershell script to create multiple global security groups.
0
Comment
Question by:LazaroB
2 Comments
 
LVL 28

Accepted Solution

by:
becraig earned 500 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now