export user list and create users in active directory

dirkdigs 921 Reputation points
2023-01-18T18:55:41.1133333+00:00

I have 100 users in M365 tenant (cloud only , no dirsync) .

I need to create same 100 users in active directory .

i need to enable dirsync.

is there easy way to create the user in active directory?

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,178 questions
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. Dillon Silzer 57,831 Reputation points Volunteer Moderator
    2023-01-18T19:48:41.75+00:00

    Hello,

    You will either want to export the users via PowerShell or go to https://admin.microsoft.com > Users > Active Users > Export Users:

    User's image

    Then you can either run one by one through the CSV or create a PowerShell script utilizing New-ADUser iteritively through the CSV file with a for each loop.

    New-ADUser

    https://learn.microsoft.com/en-us/powershell/module/activedirectory/new-aduser?view=windowsserver2022-ps

    Import-Csv

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7.3

    Side Note: You cannot use Azure AD Connect to sync from Office 365 Cloud to on-prem (as it is only on-prem to Cloud).


    If this is helpful please accept answer.


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.