Link to home
Start Free TrialLog in
Avatar of MilesLogan
MilesLoganFlag for United States of America

asked on

How to create multiple AD groups with powershell with each having a different description

Hi EE

I am trying to create some AD groups but each have a different description , how do I have the script read the CSV
and add the description to each group from the csv ?

What is below is probably not the ideal way , so I can use what ever you see is the best option..

Import-Module ActiveDirectory
$groups = Import-Csv ‘c:\PS\GroupList.csv‘
foreach ($group in $groups) {
New-ADGroup -Name $group.name -Path “OU=Groups,DC=mylab,DC=com” -GroupCategory Security -GroupScope Global -Description ??? }
ASKER CERTIFIED SOLUTION
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MilesLogan

ASKER

I was so close :)   thanks Will !!