AD Groups creation

Roger Roger 7,306 Reputation points
2021-05-11T23:01:10.43+00:00

Hi All

I have 50 groups to be created in AD under the OU OU=Groups,DC=contoso,DC=com
i have csv file in the below format, how can i import this csv file and create AD group in the OU, OU=Groups,DC=contoso,DC=com. Experts guide me
95646-groups.jpg

Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. Anonymous
    2021-05-12T01:51:53.49+00:00

    Hi,

    You can try some PowerShell script like this

    $file = "C:\temp\groups.csv"   
    $OU = "OU=Groups,DC=contoso,DC=com"  
    Import-Csv -Path $file | ForEach-Object {  
        New-ADGroup -GroupScope Global -Path $OU -Name $_."Group name" -Description $_.Description -OtherAttributes @{mail=$_.email}  
    }  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.