create a security group

Glenn Maxwell 11,496 Reputation points
2023-09-24T05:21:34.7566667+00:00

Hi All

i have a csv file in the below format. i want to import this CSV file and create mail enabled security group in Exchange onprem. I am using exchange 2016 hybrid environment. All my users are created in onprem and migrated to online. Experts guide me.mesg

.

Microsoft Exchange Online
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,588 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,676 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
2,140 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao-MSFT 37,651 Reputation points Microsoft Vendor
    2023-09-25T02:43:15.9633333+00:00

    Hi @Glenn Maxwell

    Please run the following script in Exchange Management Shell:

    import-csv C:\temp\sg.csv | foreach{
    New-DistributionGroup -Type "Security" -Name $_.Name -Alias $_.Alias -DisplayName $_.DisplayName -SamAccountName $_.SamAccountName -OrganizationalUnit $_.OU -ManagedBy $_.Owner}
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    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.


1 additional answer

Sort by: Most helpful
  1. Glenn Maxwell 11,496 Reputation points
    2023-10-02T06:14:00.78+00:00

    i want to give managed by as three users. my csv file is in below format but it is taking only first user as owner.

    Owner

    "user1@contos.com","user2@contoso.com",user3@contoso.com"


Your answer

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