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
  • Slide1 3
    Azure Virtual Networks: Preparing Azure and On-Premises Virtual Networks with Azure CLI Commands AWS/Azure/OpenShift
  • Run Linux on Windows Server
    How to install Windows Subsystem for Linux on Windows Server Linux
  • openstack ola
    Openstack Deployment with Devstack Linux
  • vcx
    Fix Error code 0x4 Session disconnected: Your session ended because of an error, if this keeps happening, contact your system administrator Windows
  • Certificate does not contain the private key
    Server Certificate could not be updated: Private key does not match Windows Server
  • allthings.how how to download and install winget windows package manager windows 10 winget cli
    How to install Winget CLI on Windows Windows Server
  • Remove Custom Domain from Entra ID and Azure tenant
    Delete Azure Tenant: Remove Custom Domain from Entra ID AWS/Azure/OpenShift
  • hero windowsserver hyperv
    Why does the legacy PXE not does work on Generation 2 VM Virtualization

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: [email protected]. 
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.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to 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

  • Set a Resource Delete Lock
    How to Add a Delete Lock on Azure Resources AWS/Azure/OpenShift
  • images 5 3
    How to uninstall AWS CLI in Windows AWS/Azure/OpenShift
  • image 12
    How to Use Postman with the Amazon Pinpoint API AWS/Azure/OpenShift
  • Secure Web Server
    How to secure a Web Server on a Windows VM in Azure using TLS/SSL Certificates Saved in Azure Key Vault AWS/Azure/OpenShift
  • Backup for Microsoft 365 and Azure
    Veeam Backup Deployment options for Microsoft 365 Data AWS/Azure/OpenShift
  • APIFEATURE
    Benefits of Azure API Management and how to create an API instance AWS/Azure/OpenShift

More Related Articles

Set a Resource Delete Lock How to Add a Delete Lock on Azure Resources AWS/Azure/OpenShift
images 5 3 How to uninstall AWS CLI in Windows AWS/Azure/OpenShift
image 12 How to Use Postman with the Amazon Pinpoint API AWS/Azure/OpenShift
Secure Web Server How to secure a Web Server on a Windows VM in Azure using TLS/SSL Certificates Saved in Azure Key Vault AWS/Azure/OpenShift
Backup for Microsoft 365 and Azure Veeam Backup Deployment options for Microsoft 365 Data AWS/Azure/OpenShift
APIFEATURE Benefits of Azure API Management and how to create an API instance 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

  • Slide1 3
    Azure Virtual Networks: Preparing Azure and On-Premises Virtual Networks with Azure CLI Commands AWS/Azure/OpenShift
  • Run Linux on Windows Server
    How to install Windows Subsystem for Linux on Windows Server Linux
  • openstack ola
    Openstack Deployment with Devstack Linux
  • vcx
    Fix Error code 0x4 Session disconnected: Your session ended because of an error, if this keeps happening, contact your system administrator Windows
  • Certificate does not contain the private key
    Server Certificate could not be updated: Private key does not match Windows Server
  • allthings.how how to download and install winget windows package manager windows 10 winget cli
    How to install Winget CLI on Windows Windows Server
  • Remove Custom Domain from Entra ID and Azure tenant
    Delete Azure Tenant: Remove Custom Domain from Entra ID AWS/Azure/OpenShift
  • hero windowsserver hyperv
    Why does the legacy PXE not does work on Generation 2 VM Virtualization

Subscribe to Blog via Email

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

Join 1,836 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

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.