MilesLogan
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 ??? }
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER