Adding groups

Adding groups

Run the following command

note: change personal lines like the path to your CSV file

Import-Module ActiveDirectory
#import csv
$groups = Import-Csv ‘C:\Users\Administrator\Documents\groups.csv' -Delimiter ';'
#loop through the csv
foreach ($group in $groups) {
    $groupProps = @{
        Name = $group.Name
        Path = $group.Path
        GroupScope = $group.Scope
        GroupCategory = $group.Category
        Description = $group.Description
    }#end groupProps
    New-ADGroup @groupProps
} #end foreach loop