Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Exam Ref AZ-104 Microsoft Azure Administrator Certification and Beyond

You're reading from   Exam Ref AZ-104 Microsoft Azure Administrator Certification and Beyond Master Azure administration and pass the AZ-104 exam with confidence

Arrow left icon
Product type Paperback
Published in Sep 2024
Publisher Packt
ISBN-13 9781805122852
Length 824 pages
Edition 3rd Edition
Arrow right icon
Author (1):
Arrow left icon
Donovan Kelly Donovan Kelly
Author Profile Icon Donovan Kelly
Donovan Kelly
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Chapter 1: Managing Microsoft Entra ID Objects 2. Chapter 2: Devices in Microsoft Entra ID FREE CHAPTER 3. Chapter 3: Managing Role-Based Access Control in Azure 4. Chapter 4: Creating and Managing Governance 5. Chapter 5: Managing Governance and Costs 6. Chapter 6: Understanding Storage Accounts 7. Chapter 7: Copying Data To and From Azure 8. Chapter 8: Securing Storage 9. Chapter 9: Storage Management and Replication 10. Chapter 10: Azure Resource Manager Templates 11. Chapter 11: Azure Bicep 12. Chapter 12: Understanding Virtual Machines 13. Chapter 13: Managing Virtual Machines 14. Chapter 14: Creating and Configuring Containers 15. Chapter 15: Creating and Configuring App Service 16. Chapter 16: Implementing and Managing Virtual Networking 17. Chapter 17: Securing Access to Virtual Networks 18. Chapter 18: Configuring Load Balancing 19. Chapter 19: Integrating On-Premises Networks with Azure 20. Chapter 20: Monitoring and Troubleshooting Virtual Networking 21. Chapter 21: Monitoring Resources with Azure Monitor 22. Chapter 22: Implementing Backup and Recovery Solutions 23. Chapter 23: Accessing the Online Practice Resources 24. Other Books You May Enjoy

Performing Bulk Operations

Bulk Microsoft Entra ID operations refer to the ability to perform a single action or update across multiple users, groups, or other objects in Microsoft Entra ID. This can be especially useful for larger organizations with hundreds or thousands of users, where manual updates to each individual object would be time-consuming and inefficient. Bulk operations in Microsoft Entra ID can be performed using PowerShell, Graph API, or other supported methods. Common bulk operations include adding or removing users from groups, updating user attributes, and managing device settings. We will explore more about the bulk operations you can perform and how they work in the following section.

Some of the popular operations you will learn about in this book perform bulk updates, such as the following:

  • Bulk user creation
  • Bulk user invitation
  • Bulk user deletion
  • Bulk user downloads

Performing Bulk Updates Using the Azure Portal

Performing bulk user updates is like managing single users (such as internal and guest users). The only property that can’t be set for multiple users is resetting a password, which must be done for a single user.

Azure has also improved its bulk user settings by adding a drop-down menu that enables you to perform updates via the downloadable CSV template, which you then re-upload.

Downloading a User List

To download a user list, you can follow the given steps:

  1. Navigate to the Users overview blade again in Microsoft Entra ID. You should automatically go into the All users blade; if not, select that option.
  2. Click Download users from the top menu.
Figure 2.30: Bulk operations – clicking Download users

Figure 2.30: Bulk operations – clicking Download users

  1. Enter a desired filename and click Start. This will be saved as a .csv file, which can be opened in Microsoft Excel if you desire for easy editing. A free version can be used with Microsoft 365 Office online. You can read more about this at this link: https://www.microsoft.com/en-us/microsoft-365/free-office-online-for-the-web. Being a comma-separated file type, where each value is separated by a comma, you can use any text editor, such as Windows Notepad.

Figure 2.31: Bulk operations – Download users

Figure 2.31: Bulk operations – Download users

  1. Once complete, the option to download the file will appear. Click the blue text to download.

Figure 2.32: Downloading the user’s CSV file

Figure 2.32: Downloading the user’s CSV file

When opening the file, if you are presented with what looks like gibberish, you can do the following in Excel to format it neatly for yourself:

  1. Click the A column to select all the data:
Figure 2.33: Bulk operations – selecting the A column in Excel

Figure 2.33: Bulk operations – selecting the A column in Excel

  1. Then, select the Data tab from the top menu bar, and then select Text to Columns from the Data Tools context.
Figure 2.34: Bulk operations – selecting Text to Columns in Excel

Figure 2.34: Bulk operations – selecting Text to Columns in Excel

  1. On the screen that pops up, click Delimited and then Next.
Figure 2.35: Bulk Operations – Delimited in Excel

Figure 2.35: Bulk Operations – Delimited in Excel

  1. Select Comma, and then click Next >.
Figure 2.36: Bulk operations – selecting Comma

Figure 2.36: Bulk operations – selecting Comma

  1. Click General for Column data format, and then click Finish.

Figure 2.37: Bulk Operations – selecting the column data format in Excel

Figure 2.37: Bulk Operations – selecting the column data format in Excel

Now, your data will be organized neatly into columns. Next, you will learn how to use this sheet to perform bulk deletion operations in Microsoft Entra ID.

Bulk User Deletion Operations

To demonstrate a bulk deletion, you will select and keep the users you want to retain in the sheet and delete the rows with the remaining users:

  1. Navigate back to the Users blade and select All users.
  2. Click Bulk operations and then Bulk delete.
Figure 2.38: Microsoft Entra ID – Bulk delete

Figure 2.38: Microsoft Entra ID – Bulk delete

  1. Click Download.

Figure 2.39: Microsoft Entra ID – the bulk delete template

Figure 2.39: Microsoft Entra ID – the bulk delete template

  1. Modify the sheet and paste in the user principal name for each user, from row 3 downward. You can copy these users from the sheet you downloaded in the last exercise. Click Save once you are finished and close the Excel sheet.

Figure 2.40: Bulk Operations – selecting users to delete in Excel

Figure 2.40: Bulk Operations – selecting users to delete in Excel

  1. Back in the Azure portal, click the Select a file option from the previous screen. From the open file dialog that pops up, navigate to your file, and then click Open.
  2. In the Azure portal, select Yes for the Are you sure you want to perform the delete operation? option, and then click Submit. You will be presented with a success notification once completed successfully.
  3. That concludes the bulk user delete operation demonstration. Next, you will briefly explore other possible ways to modify Microsoft Entra ID user accounts.

Updating Multiple Users

You can also update multiple users by selecting them and choosing to delete them, or you can configure MFA for each user from the Azure portal in the Users blade:

Figure 2.41: An alternative bulk user delete method

Figure 2.41: An alternative bulk user delete method

This concludes our demonstration of how to perform bulk user deletion operations using the Azure portal. Next, we will take a look at a PowerShell script that I think can help you achieve bulk user creation.

Performing Bulk Creations Using PowerShell

You will now experience running a PowerShell script to enable you to create Microsoft Entra ID users quickly and programmatically in your environment. The following script will create several demo users with a predefined password for you:

  1. Start by opening your favorite code editor or notepad; I recommend VS Code, which you can download from here: https://code.visualstudio.com/download.
  2. Paste the following code and save the file as a .ps1 file, with whatever name prefix you want. To follow this exercise, it is advised that you save the file in C:\Scripts on your computer and name it Create_AzureAD_Users.ps1. You will need to populate the $TenantId and $DomainSuffix details in between the inverted commas on the right.

    Create_AzureAD_Users.ps1

    # Enter the Tenant ID for your Azure AD
    $TenantId = ""
    # Populate your Domain Suffix
    $DomainSuffix = ""
    # List of usernames to create
    $UserNames = @(
        "John Smith",
        "Jane Doe",
        "Robert Johnson",
  1. Note the location of your script (e.g., C:\Scripts), and then open PowerShell.
  2. Type in cd and the path to your script, and then press the Enter key.
Figure 2.42: Changing the directory on PowerShell

Figure 2.42: Changing the directory on PowerShell

  1. Now, to run the script, enter .\ and start typing your script name. The .\ notation means that you will look in the path that you are currently in – in my example, C:\Scripts. Click Enter once you have your script.
Figure 2.43 – Launching the Create_EntraID_Users script

Figure 2.43 – Launching the Create_EntraID_Users script

  1. A prompt will pop up, asking you to authenticate; enter your details and sign in.

Figure 2.44: Azure’s Sign in prompt

Figure 2.44: Azure’s Sign in prompt

  1. Return to the Azure portal and navigate to Microsoft Entra ID, and then the Users blade. You should see your new users there.

This concludes our demonstration on how to perform bulk user creations using a PowerShell script, helping you to achieve a consistent deployment methodology that can also save you time.

Note

You are encouraged to read further by using the following links, which look at adding bulk users:

https://learn.microsoft.com/en-us/entra/identity/users/users-bulk-add

https://learn.microsoft.com/en-us/entra/identity/users/groups-bulk-import-members

In the next section, we are going to cover how you can manage guest accounts.

You have been reading a chapter from
Exam Ref AZ-104 Microsoft Azure Administrator Certification and Beyond - Third Edition
Published in: Sep 2024
Publisher: Packt
ISBN-13: 9781805122852
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime