Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » AWS/Azure/OpenShift » Perform Bulk User Operations in Azure AD
  • GitLab 1
    How to Setup GitLab Runner on WSL Linux
  • Network unlock
    How to configure Network Unlock in Windows Windows Server
  • what is saml e1690630549650
    What is SAML – Security Assertion Markup Language Windows Server
  • screenshot 2020 02 09 at 17.11.11
    How to uninstall a program via command prompt in Windows Windows
  • 87a26c60 0001 0004 0000 000001423515 w948 r1.77 fpx54.99 fpy56.04
    Administer LXC Containers: Easy Guide Virtualization
  • APIFEATURE
    Benefits of Azure API Management and how to create an API instance AWS/Azure/OpenShift
  • windows update 03
    Fix Windows cannot check for updates in Windows 8, 7, and 10 Windows
  • TrueCrypt to BitLocker
    How to Migrate from TrueCrypt to BitLocker Backup

Perform Bulk User Operations in Azure AD

Posted on 18/05/202331/05/2023 Imoh Etuk By Imoh Etuk No Comments on Perform Bulk User Operations in Azure AD
Bulk-operations-in-Azure-AD

In this post, I show you how to perform bulk user operations in Azure AD. Azure AD or Azure Active Directory is a part of Microsoft Entra. It is an enterprise identity service that provides single sign-on, multifactor authentication, and conditional access to guard against 99.9 per cent of cybersecurity attacks. To use Azure AD, you must have an Azure AD Tenant set up for your organization. Azure AD also enables you to sync your on-premises directory to the Cloud by using the Azure AD Connect tool. To learn more about using Azure AD for your on-premises, review the various methods of integrating Azure Active Directory with on-Premise Active Directory

Azure Active Directory (Azure AD) allows enterprises to create new users in bulk, delete current users in mass, and restore deleted users in bulk. To download the selected users from the Azure AD interface, you must first fill out a comma-separated values (CSV) template. You can also learn how to manage Microsoft 365 User Accounts account such as account creation, assigning licenses, and viewing unlicensed accounts with PowerShell.

Creating Bulk Users in Azure AD

To carry out bulk user operations in the Azure AD portal using the Microsoft Entra admin center, you must sign-in as a Global Administrator or User Administrator.

To perform tasks such as bulk user creation, deletion and restoration, an administrator must download the UserCreateTemplate, UserDelete, and UserRestoreTemplate CSV file from the Azure AD Portal. The CSV template for bulk user creations differs significantly from the template for bulk user deletions, which differs slightly from the template for bulk user restoration of deleted users. For the appropriate bulk procedure, organizations should download and complete the CSV template.

To create bulk users using the UserCreateTemplate CSV file, follow the steps below:

Step 1: Log into the Azure AD Portal using an account with either Global administrator or User administrator privileges.
Step 2: From the Azure AD admin center, select Users > Bulk create

Bulk-Create-users
Downloading the UserCreateTemplate CSV File

On the  Bulk Create user page, select Download to download a valid comma-separated values (CSV) file of user properties, and then add the users you want to create as shown below. Note, you’re not expected to alter the column headings of the CSV template.

Filled-bulk-create-excel-sheet
Filled UserCreateTemplate CSV File

Step 3: On the Bulk Create user page, click on Upload to upload your CSV file, browse to the file and click on Submit to start validating the CSV file.

bulk-create-file-uploaded-2
UserCreateTemplate CSV File Uploaded

After the system validates the file contents, a File uploaded successfully message appears. If there are errors, you must fix them before you can submit the job.

Checking the status of the bulk operations

You can check the status of the bulk operation on the Bulk operation results page.

Success-status-bulk-user-creation
Status of Bulk User Creation

From the status screen above, only one operation reportedly failed because the user matches an existing user name in my Azure AD. If you navigate to the user list in your Azure AD, you would see all the newly created users.

list-of-bulk-users-created
Newly Created Users

Please see How to Upload Batch Files to Azure Storage Account Using Azure CLI, How to Batch rename multiple files on Windows, How to use the built-in Azure Active Directory Connect tool, how to Visualize MBAM Recovery Audit Report with Python, and How to Rename or Move a File or Directory in Linux – Bash Terminal Command.

Verify users were created using PowerShell

To confirm that users were created using PowerShell, you must first call the Connect-MgGraph -Scopes 'User.Read.All' Cmdlet command. After calling the command, run the below command to verify that those users were created:

Get-MgUser -Filter "UserType eq 'Member'"
6-newly-created-users-verified
Newly created users verified

Deleting Users in Bulk

The same way we created users by downloading the CSV file from the Azure AD Portal is the same we will also delete users. The delete user operation uses a CSV file to identify the users you want to delete.

The CSV template used for bulk deletion looks a little bit different from the template used for bulk creation. The template only requires one column instead two columns as shown in the below screenshot.

bulk-delete-template-sample
Sample User Delete Template
The rows in the downloaded CSV template to bulk deleted existing users are as follows:

1. Version number. The upload CSV file must contain the version number in the first row.
2. Column headings. User name [userPrincipalName] Required. Older versions of the template may vary.
3. Examples row. The template includes an example of an acceptable value. Example: chris@contoso.com. 
Note: You must remove the example row and replace it with your own entries.

Take the following steps to accomplish the bulk user delete operations:

Step 1: Navigate to All Users > Bulk deletes> Download the UserDelete CSV file.

download-bulk-delete-template
Bulk User Delete Operation

Step 2: Complete the entries with the names of the users you want to delete.

Users-to-bulk-delete-loaded
Users to be deleted in Bulk

Step 3: Upload the complete User delete CSV file back to the Azure AD portal for validation and further action.

confirm-delete-operation
click-to-view-the-status

At this point, you will be prompted to type “Yes” to confirm the deletion operation. Go ahead and type Yes and then Submit. You can assess the “Click here to view the status of each operation” to view the status.

bulk-delete-success-status
User Delete Status

From the screenshot above only one user failed the deletion operation. Download the task to view the failure reason as shown below:

failed-reason-for-bulk-delete-users
User delete failure reason

Now that we have learned how to bulk create and delete users, let us see how we can also restore the deleted users in bulk.

Restoring Users in Bulk

Just it is required to download the UserCreateTemplate and UserDelete CSV file, it is also required that we download the UserRestoreTemplate.

To restore bulk users, follow the following steps:

Step 1: Download the UserRestoreTemplate CSV file by navigating to the Users > Deleted users > Bulk restore > Download.

bulk-restore-template
Downloading the Bulk User Restore Template

Step 2: Complete the UserRestoreTemplate CSV file with all the entries you want to restore.

deleted-users-to-restore
Deleted users to be restored
Note, only Object ID are required to restore deleted users. You can call the Object ID by running the Get-AzureADUser cmdlet command

Step 3: Uploaded the UserRestoreTemplate to the Azure AD portal for further action.

upload-the-deleted-users
UserRestoreTemplate CSV file uploaded

Next, you will see the successful prompt that the file was successfully uploaded. Click on Submit to submit the task.

submit-deleted-template
Submitting UserRestoretemplate

You will receive a notification for the successful restoration of the deleted users.

deleted-users-restored-success
Deleted users restored

You can click download the file to see the result.

Restored-success-excel-file
Deleted Users restored

In conclusion, Azure AD enables organizations of all sizes to empower their employees to collaborate and access external resources, such as Microsoft 365, the Azure portal, and thousands of other SaaS applications. It also helps them access internal resources like apps on your corporate intranet, and any cloud apps developed for your own organization. With Azure Active Directory (Azure AD), you can create, verify created users using PowerShell, and delete, and restore users in bulk. This action helps to improve efficiency and save time.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
AWS/Azure/OpenShift Tags:Azure, Azure Active Directory, Azure AD

Post navigation

Previous Post: Manage MS365 Accounts with PowerShell
Next Post: How to Install SASS on VsCode

Related Posts

  • AWS import issues   OVA
    Error importing OVA file to AWS: Client error saved empty is empty AWS/Azure/OpenShift
  • DevOps GIT Docker Kubernetes
    Azure DevOps: Docker and Kubernetes Deployment with GitHub AWS/Azure/OpenShift
  • Azure Storage 1
    Azure CLI: How To Upload Batch Files to Azure Storage Account AWS/Azure/OpenShift
  • azure
    Enter connection information for your on-premise directory or forests: Azure AD connect unable to connect directory, forest not available AWS/Azure/OpenShift
  • powershell01 3
    How to install and Update Azure PowerShell on your Windows PC AWS/Azure/OpenShift
  • Webp.net resizeimage 2
    Add or Remove Network Interface from a VM in Azure AWS/Azure/OpenShift

More Related Articles

AWS import issues   OVA Error importing OVA file to AWS: Client error saved empty is empty AWS/Azure/OpenShift
DevOps GIT Docker Kubernetes Azure DevOps: Docker and Kubernetes Deployment with GitHub AWS/Azure/OpenShift
Azure Storage 1 Azure CLI: How To Upload Batch Files to Azure Storage Account AWS/Azure/OpenShift
azure Enter connection information for your on-premise directory or forests: Azure AD connect unable to connect directory, forest not available AWS/Azure/OpenShift
powershell01 3 How to install and Update Azure PowerShell on your Windows PC AWS/Azure/OpenShift
Webp.net resizeimage 2 Add or Remove Network Interface from a VM in Azure AWS/Azure/OpenShift

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • GitLab 1
    How to Setup GitLab Runner on WSL Linux
  • Network unlock
    How to configure Network Unlock in Windows Windows Server
  • what is saml e1690630549650
    What is SAML – Security Assertion Markup Language Windows Server
  • screenshot 2020 02 09 at 17.11.11
    How to uninstall a program via command prompt in Windows Windows
  • 87a26c60 0001 0004 0000 000001423515 w948 r1.77 fpx54.99 fpy56.04
    Administer LXC Containers: Easy Guide Virtualization
  • APIFEATURE
    Benefits of Azure API Management and how to create an API instance AWS/Azure/OpenShift
  • windows update 03
    Fix Windows cannot check for updates in Windows 8, 7, and 10 Windows
  • TrueCrypt to BitLocker
    How to Migrate from TrueCrypt to BitLocker Backup

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,832 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.