I have a pretty simple script today. All it does is import your Active Directory group information from the CSV file and create the groups based on the information imported. This is pretty much as simple as it gets but very effective for creating multiple groups in different organizational units.
The format of the CSV file is in the code below. If you have questions leave a comment below or on the Youtube video or with the Social Media links below or you can hunt me down and ask in person as well.
*** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK ***
Read Active Directory group info from groups.csv and create the groups.
Example CSV File:
GroupName GroupCategory GroupScope OU
Finance Security Global OU=_Groups,DC=signalwarrant,DC=local
R&D Security Global OU=_Groups,DC=signalwarrant,DC=local
IT Security Global OU=_Groups,DC=signalwarrant,DC=local
HR Security Global OU=_Groups,DC=signalwarrant,DC=local
Executive Security Global OU=_Groups,DC=signalwarrant,DC=local
Author: David Hall
Google +: plus.google.com/113307879414407675617
YouTube Subscribe link: https://www.youtube.com/channel/UCgWfCzNeAPmPq_1lRQ64JtQ?sub_confirmation=1
$csv = Import-Csv -Path "c:\scripts\groups.csv"
ForEach ($item In $csv)
$create_group = New-ADGroup -Name $item.GroupName -GroupCategory $item.GroupCategory -groupScope $item.GroupScope -Path $item.OU
Write-Host -ForegroundColor Green "Group $($item.GroupName) created!"