How To Create Bulk Users in #Azure Active Directory with PowerShell #AzureAD #PowerShell #AAD

Introduction

Azure Active Directory (AAD) is Microsoft’s multi-tenant, cloud based directory and identity management service. Azure AD combines core directory services, advanced identity governance, and application access management. Azure AD also offers a rich, standards-based platform that enables developers to deliver access control to their applications, based on centralized policy and rules.

Azure AD can be integrated with an existing Windows Server Active Directory by using Azure AD Connect, giving you the ability to leverage your existing AD infrastructure identity investments on-premises to manage access to cloud based Software as a Service (SaaS) applications.

Creating a user in Azure Active Directory is a very simple process. You can refer to the following guide to add and delete users in Azure Active Directory using the Azure portal.

One of the most challenging task, is when you have to create a large number of users in Azure Active Directory. The portal is not an efficient way to accomplish this task.

Fortunately, Microsoft released Azure Active Directory Powershell module that will help to automate this process.

In this post, I will show you how to automate and import a list of users from a csv file, and then create the corresponding accounts in Azure Active Directory.

Create Bulk Users in Azure Active Directory

The following code will import a list of users from a CSV File and then create the corresponding accounts in Azure Active Directory.

How to use this tool?

You can run this tool using a single line of PowerShell as follows:

If Azure AD PowerShell module is not present on your system, then the module will be installed automatically, and the users will be created in Azure AD.

If the user password is not defined in the CSV file, you will be asked to type a random password in secure format. 

This tool will also force the user to change the password at next login.

Here is the view in Azure portal after running this tool.

Where can I download this script?

This script is available on my GitHub repository. You can download it from here. If you have any feedback or changes that everyone should receive, please feel free to leave a comment, update the source and create a pull request.

Hope this helps!

Cheers,
-Charbel

Advertisements
About Charbel Nemnom 399 Articles
Charbel Nemnom is a Cloud Solutions Architect and Microsoft Most Valuable Professional (MVP), totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 17 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

Be the first to comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.