# AZ-104 Azure Identity - LAB Perform Bulk Microsof Entra ID Operations in the Portal

**Scenario**

To help you walk through the lab, consider the following scenario:

You work as a systems administrator for an organization that has a lot of seasonal projects. As a result, it's very common for you to have to create and delete a large volume of users every few months throughout the year, as well as manage relevant security groups.

You have some spare time now before the project season begins, and you would like to investigate the use of bulk operations to help minimize your workload during these seasonal high peaks.

To get started, you would like to practice the following operations within your empty demo Microsoft Entra ID tenant:

<div class="css-xjv02e" id="bkmrk-creating-and-deletin"><div class="css-xjv02e"><div class="sc-kAyceB jjMCa-D" color="#C1C0D1">1. Creating and deleting users in bulk
2. Managing group membership in bulk

---

</div></div></div>**Lab Setup**

The objectives for this hands-on lab can be completed using the Azure portal. Specifically, all tasks will be performed using the *Microsoft Entra ID* service pages.

<iframe allowfullscreen="allowfullscreen" height="452" src="https://www.youtube.com/embed/LP6WYh2191E" style="width: 803px; height: 449px;" width="808"></iframe>

<details id="bkmrk-solution-bulk-create"><summary>Solution</summary>

### Bulk Create Users

#### Download and Edit the Template Used to Bulk Create Users

1. In the Azure portal, click the hamburger icon at the top-left of the screen to open the menu.
2. From the menu, select **Microsoft Entra ID**.
3. From the menu on the left, select **Users**.
4. From the menu at the top, click the **Bulk operations** drop-down.
5. Click **Bulk create**.
6. In the *Bulk create user* pane that displays on the right, click the **Download** button to download the latest CSV template.
7. Navigate to and open the CSV template file that was downloaded.
8. View the fields included in the template. Take note of any required fields and the total number of fields, as you will need to include some sort of information for each field.
    
    > **Note:** The template provided from Microsoft may be updated over time, and the fields included in the template (both required and optional) are subject to change. For that reason, we cannot provide you with a list of fields and the information to include or a mocked up file to be uploaded.
9. Enter information for the three new users you want to add, including data for — at minimum — each of the required fields.
    
    
    - The required fields likely include the user's name that is aligned with their *Name* and a username (in the form of an email address) that is aligned with their *User Principal Name* in AD.
    - To obtain the proper domain for the *User Principal Name* field, navigate back to the Azure portal and click on a user in the *All users* list; where their *User Principal Name* is listed, copy the domain following the `@` symbol (including the `@` symbol), and paste it into the template for each user you create.
    - The remaining fields will need to be accounted for in the template with a comma.
    - Do not include spaces between the commas and the field data. Spaces between them will cause the upload and bulk creation process to fail.
    - For example, at the time this lab was made, an entry in the template included the following fields:
        
        `[First Name] [Last Name],[username]@[userPrincipalName],[password],No,,,,,,,,,,,,,`
        
        `Amos Smith,amos@radlabs4p.onmicrosoft.com,password123!,No,,,,,,,,,,,,,`
10. Once you have entered the users to be added, save your changes to the file.

#### Upload Your Edited File and Execute the Bulk Create User Process

1. Back in the Azure portal, in the *Bulk create user* pane on the right, click the folder icon next to the *Upload your csv file* field.
    
    > **Note:** If you navigated away from the page to copy the domain name for the users while editing the template, you may need to navigate back to the *All users* page and then click **Bulk operations &gt; Bulk create** to open the pane again.
2. Navigate to the location of your edited template file and select it.
3. If there are any issues with the data in the file, you will receive a notification of the errors in the *Bulk create user* pane. If any exist, fix the errors, save the file, and upload it again.
    
    > **Note:** You may have to repeat this process until your file has no errors.
4. When your file has uploaded successfully, click the **Submit** button.
    
    > **Note:** It may take some time to create your users.
5. You will receive a status notification about the creation process in the *Bulk create user* pane.
    
    > **Note:** If there are any issues during the creation process, you can click **Bulk operation results** in the menu on the left, click on your file in the list, and view the errors it encountered.
6. From the menu at the top, click **Refresh** and verify that the new users now appear in the list of *All users*.

### Bulk Delete Users

#### Download and Edit the Template Used to Bulk Delete Users

1. From the menu at the top, click the **Bulk operations** drop-down.
2. Click **Bulk delete**.
3. In the *Bulk delete user* pane that displays on the right, click the **Download** button to download the latest CSV template.
4. Navigate to and open the CSV template file that was downloaded.
5. View the fields included in the template. Take note of any required fields and the total number of fields, as you will need to include some sort of information for each field.
6. Enter information for the user you want to delete, including data for the required field.
    
    
    - The required fields likely include the username that is aligned with their *User Principal Name* in AD.
    - For example, at the time this lab was made, an entry in the template included the following fields:
        
        `[username]@[userPrincipalName]`
        
        `amos@radlabs4p.onmicrosoft.com`
7. Once you have entered the user to be deleted, save your changes to the file.

#### Upload Your Edited File and Execute the Bulk Delete User Process

1. Back in the Azure portal, in the *Bulk delete user* pane on the right, click the folder icon next to the *Upload your csv file* field.
    
    > **Note:** If you navigated away from the page to copy the *User Principal Name* for the user while editing the template, you may need to navigate back to the *All users* page and then click **Bulk operations &gt; Bulk delete** to open the pane again.
2. Navigate to the location of your edited template file and select it.
3. If there are any issues with the data in the file, you will receive a notification of the errors in the *Bulk delete user* pane. If any exist, fix the errors, save the file, and upload it again.
4. Once your file has uploaded successfully, type `Yes` in the *Are you sure you want to perform the delete operation?* field.
5. Click the **Submit** button.
6. You will receive a status notification about the deletion process in the *Bulk delete user* pane.
    
    > **Note:** If there are any issues during the deletion process, you can click **Bulk operation results** in the menu on the left, click on your file in the list, and view the errors it encountered.
7. From the menu at the top, click **Refresh** and verify that the user has been removed from the list of *All users*.

### Bulk Add Group Members

#### Create the Group

1. Using the breadcrumb trail at the top, navigate back to the Microsoft Entra ID tenant.
2. From the menu on the left, select **Groups**.
3. From the menu at the top, click **New group**.
4. From the *Group type* drop-down, select **Security**.
5. In the *Group name* field, enter a name for the group.
6. Leave everything else as is, and click **Create**.

#### Download and Edit the Template Used to Bulk Import Members

1. In the list of groups in the *All groups* view, click on the name of the Security group you created.
2. From the menu on the left, select **Members**.
3. From the menu at the top, click the **Bulk operations** drop-down.
4. Click **Import members**.
5. In the *Bulk import group* pane that displays on the right, click the **Download** button to download the latest CSV template.
6. Navigate to and open the CSV template file that was downloaded.
7. View the fields included in the template. Take note of any required fields and the total number of fields, as you will need to include some sort of information for each field.
8. Enter information for the users you want to add to the group, including data for the required field.
    
    
    - The required fields likely include the user's *Object ID* **or** the username that is aligned with their *User Principal Name* in AD.
    - For example, at the time this lab was made, an entry in the template included the following fields:
        
        `[username]@[userPrincipalName]`
        
        `amos@radlabs4p.onmicrosoft.com`
        
        or
        
        `[memberObjectID]`
        
        `dec3f879-9439-4978-94be-17f17cefc0aa`
    
    > **Note:** You can quickly find this information for each user within the *All users* view in the portal. Modify the view by clicking on **Manage view** in the top menu and then select **Edit columns**. Select only the *User principal name* and *Object ID* options (*Object ID* may need to be added), and click **OK**. Now, the *User Principal Name* and *Object ID* are displayed for each user, which you can then copy and paste into your CSV file.
9. Once you have entered the users to be added to the group, save your changes to the file.

#### Upload Your Edited File and Execute the Bulk Import Group Process

1. Back in the Azure portal, in the *Bulk import group* pane on the right, click the folder icon next to the *Upload your csv file* field.
    
    > **Note:** If you navigated away from the page to copy the *User Principal Name* or *Object ID* for the users while editing the template, you may need to navigate back to the *All groups* page, then click **Members** in the menu on the left, and then click **Bulk operations &gt; Import members** to open the pane again.
2. Navigate to the location of your edited template file and select it.
3. If there are any issues with the data in the file, you will receive a notification of the errors in the *Bulk import group* pane. If any exist, fix the errors, save the file, and upload it again.
4. When your file has uploaded successfully, click the **Submit** button.
5. You will receive a status notification about the import process in the *Bulk import group* pane.
    
    > **Note:** If there are any issues during the import process, you can click **Bulk operation results** in the menu on the left, click on your file in the list, and view the errors it encountered.
6. From the menu at the top, click **Refresh** and verify that the users now appear in the list of *Members*.

</details>