Skip to content

Bulk User Operations

AZ-104 Weight: Low - Know the concept and CSV format


Overview

Bulk operations let you create, invite, or delete multiple users at once using CSV files. Useful for:

  • Onboarding many new employees
  • Migrating users from another system
  • Quarterly cleanup of inactive accounts
  • Inviting many external partners at once

Available Bulk Operations

OperationDescriptionPortal Location
Bulk createCreate multiple new usersUsers > Bulk create
Bulk inviteInvite multiple guest usersUsers > Bulk invite
Bulk deleteDelete multiple usersUsers > Bulk delete
Download usersExport user list to CSVUsers > Download users

Bulk Create Users

CSV Template Format

csv
Name [displayName] Required,User name [userPrincipalName] Required,Initial password [passwordProfile] Required,Block sign in (Yes/No) [accountEnabled] Required,First name [givenName],Last name [surname],Job title [jobTitle],Department [department],Usage location [usageLocation],Street address [streetAddress],State or province [state],Country or region [country],Office [physicalDeliveryOfficeName],City [city],ZIP or postal code [postalCode],Office phone [telephoneNumber],Mobile phone [mobile]
John Doe,john.doe@contoso.onmicrosoft.com,TempP@ss123!,No,John,Doe,Developer,Engineering,US,123 Main St,WA,US,Building A,Seattle,98101,555-1234,555-5678
Jane Smith,jane.smith@contoso.onmicrosoft.com,TempP@ss456!,No,Jane,Smith,Manager,Sales,US,456 Oak Ave,CA,US,Building B,Los Angeles,90001,555-2345,555-6789

Required Fields

FieldDescriptionExample
displayNameFull nameJohn Doe
userPrincipalNameSign-in namejohn.doe@domain.com
passwordProfileInitial passwordMust meet complexity
accountEnabledYes/NoNo = blocked

Portal Walkthrough: Bulk Create

  1. Go to Microsoft Entra admin center
  2. Navigate to Identity > Users > All users
  3. Click Bulk operations > Bulk create
  4. Download the CSV template
  5. Fill in user data (keep the header row!)
  6. Upload the completed CSV
  7. Click Submit

Checking Results

  1. After submit, click Download results
  2. Review the results CSV:
    • Success: User created
    • Failure: Shows error reason (duplicate UPN, bad password, etc.)

Bulk Invite Guests

CSV Template Format

csv
Email address to invite [inviteeEmail] Required,Redirection url [inviteRedirectURL] Required,Send invitation message (Yes/No) [sendEmail],Customized invitation message [customizedMessageBody]
partner1@external.com,https://portal.azure.com,Yes,Welcome to our project collaboration!
partner2@external.com,https://myapp.azurewebsites.net,Yes,You're invited to access our partner portal.
consultant@vendor.com,https://portal.azure.com,No,

Required Fields

FieldDescription
inviteeEmailExternal email address
inviteRedirectURLWhere to send user after acceptance

Bulk Delete Users

CSV Format

csv
User name [userPrincipalName] Required
john.doe@contoso.onmicrosoft.com
jane.smith@contoso.onmicrosoft.com
temp.user@contoso.onmicrosoft.com

Important Notes

  • Deleted users go to Deleted users (soft delete)
  • Can be restored within 30 days
  • Permanent deletion after 30 days
  • Cannot bulk delete users with active admin roles

Download Users

Export your user list for:

  • Auditing purposes
  • Backup before changes
  • Analysis in Excel
  • Input for other bulk operations

Steps:

  1. Users > All users
  2. Click Download users
  3. Select columns to include
  4. Choose format (CSV)
  5. Click Start and download when ready

PowerShell Alternative

For larger operations or automation:

powershell
# Import users from CSV
$users = Import-Csv -Path "users.csv"

foreach ($user in $users) {
    $passwordProfile = @{
        Password = $user.Password
        ForceChangePasswordNextSignIn = $true
    }
    
    New-MgUser `
        -DisplayName $user.DisplayName `
        -UserPrincipalName $user.UserPrincipalName `
        -PasswordProfile $passwordProfile `
        -AccountEnabled:$true `
        -MailNickname ($user.UserPrincipalName -split '@')[0] `
        -Department $user.Department `
        -JobTitle $user.JobTitle
}

# Bulk invite guests
$guests = Import-Csv -Path "guests.csv"

foreach ($guest in $guests) {
    New-MgInvitation `
        -InvitedUserEmailAddress $guest.Email `
        -InvitedUserDisplayName $guest.Name `
        -InviteRedirectUrl "https://portal.azure.com" `
        -SendInvitationMessage:$true
}

Common Errors and Solutions

ErrorCauseSolution
Invalid UPN formatUPN doesn't match domainUse verified domain
Password doesn't meet requirementsWeak passwordUse complex password
User already existsDuplicate UPNCheck for existing user
Invalid usage locationBad country codeUse 2-letter ISO code
Quota exceededToo many usersContact Microsoft support

Best Practices

  1. Always download template - Don't create CSV from scratch
  2. Test with small batch - Try 2-3 users first
  3. Check results file - Review every failure
  4. Use consistent data - Standardize department names, etc.
  5. Backup first - Download existing users before bulk delete

Exam Tips

  • Know that bulk operations use CSV files
  • Understand the required fields for each operation
  • Know that deleted users can be restored within 30 days
  • PowerShell/Graph API is available for automation
  • Operations are asynchronous - results come later

Practice Question

Scenario: You need to create 500 user accounts for new employees starting next month. You have their information in an HR spreadsheet.

What is the MOST efficient method?

A) Create each user manually in the portal
B) Use bulk create with a CSV file
C) Use Azure CLI in a loop
D) Create users via Azure DevOps pipeline

Answer

B) Use bulk create with a CSV file

Explanation: For one-time bulk creation of many users:

  1. Download the CSV template
  2. Copy data from HR spreadsheet
  3. Upload and create all users at once

While CLI/PowerShell works, CSV upload is simpler for one-time operations without coding. Azure DevOps is overkill for this scenario.

Released under the MIT License.