Skip to content

Commit b45120e

Browse files
committed
Microsoft Graph example
1 parent 328ad28 commit b45120e

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

articles/active-directory/external-identities/tutorial-bulk-invite.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
---
22

33
title: Tutorial for bulk inviting B2B collaboration users - Azure AD
4-
description: In this tutorial, you learn how to use PowerShell and a CSV file to send bulk invitations to external Azure AD B2B collaboration users.
4+
description: In this tutorial, you learn how to use PowerShell and a CSV file to send bulk invitations to external Azure AD B2B collaboration users. You'll use the Microsoft.Graph.Users PowerShell module.
55

66
services: active-directory
77
ms.service: active-directory
88
ms.subservice: B2B
99
ms.topic: tutorial
10-
ms.date: 03/17/2021
10+
ms.date: 02/16/2022
1111

1212
ms.author: mimart
1313
author: msmimart
1414
manager: celestedg
15-
ms.reviewer: mal
1615

1716
# Customer intent: As a tenant administrator, I want to send B2B invitations to multiple external users at the same time so that I can avoid having to send individual invitations to each user.
1817

@@ -21,7 +20,7 @@ ms.collection: M365-identity-device-management
2120

2221
# Tutorial: Bulk invite Azure AD B2B collaboration users
2322

24-
If you use Azure Active Directory (Azure AD) B2B collaboration to work with external partners, you can invite multiple guest users to your organization at the same time. In this tutorial, you learn how to use the Azure portal to send bulk invitations to external users. Specifically, you do the following:
23+
If you use Azure Active Directory (Azure AD) B2B collaboration to work with external partners, you can invite multiple guest users to your organization at the same time. In this tutorial, you learn how to use the Azure portal to send bulk invitations to external users. Specifically, you'll follow these steps:
2524

2625
> [!div class="checklist"]
2726
> * Use **Bulk invite users** to prepare a comma-separated value (.csv) file with the user information and invitation preferences
@@ -42,13 +41,13 @@ The rows in a downloaded CSV template are as follows:
4241

4342
- **Version number**: The first row containing the version number must be included in the upload CSV.
4443
- **Column headings**: The format of the column headings is <*Item name*> [PropertyName] <*Required or blank*>. For example, `Email address to invite [inviteeEmail] Required`. Some older versions of the template might have slight variations.
45-
- **Examples row**: We have included in the template a row of examples of values for each column. You must remove the examples row and replace it with your own entries.
44+
- **Examples row**: We've included in the template a row of examples of values for each column. You must remove the examples row and replace it with your own entries.
4645

4746
### Additional guidance
4847

4948
- The first two rows of the upload template must not be removed or modified, or the upload can't be processed.
5049
- The required columns are listed first.
51-
- We don't recommend adding new columns to the template. Any additional columns you add are ignored and not processed.
50+
- We don't recommend adding new columns to the template. Any columns you add are ignored and not processed.
5251
- We recommend that you download the latest version of the CSV template as often as possible.
5352

5453
## Prerequisites
@@ -83,7 +82,7 @@ You need two or more test email accounts that you can send the invitations to. T
8382
7. On the **Bulk invite users** page, under **Upload your csv file**, browse to the file. When you select the file, validation of the .csv file starts.
8483
8. When the file contents are validated, you’ll see **File uploaded successfully**. If there are errors, you must fix them before you can submit the job.
8584
9. When your file passes validation, select **Submit** to start the Azure bulk operation that adds the invitations.
86-
10. To view the job status, select **Click here to view the status of each operation**. Or, you can select **Bulk operation results** in the **Activity** section. For details about each line item within the the bulk operation, select the values under the **# Success**, **# Failure**, or **Total Requests** columns. If failures occurred, the reasons for failure will be listed.
85+
10. To view the job status, select **Click here to view the status of each operation**. Or, you can select **Bulk operation results** in the **Activity** section. For details about each line item within the bulk operation, select the values under the **# Success**, **# Failure**, or **Total Requests** columns. If failures occurred, the reasons for failure will be listed.
8786

8887
![Example of bulk operation results](media/tutorial-bulk-invite/bulk-operation-results.png)
8988

@@ -102,25 +101,30 @@ Check to see that the guest users you added exist in the directory either in the
102101

103102
### View guest users with PowerShell
104103

104+
To view guest users with PowerShell, you'll need the [Microsoft.Graph.Users PowerShell Module](/powershell/module/microsoft.graph.users/?view=graph-powershell-beta). Then sign in using the `Connect-MgGraph` command with an admin account to consent to the required scopes:
105+
```powershell
106+
Connect-MgGraph -Scopes "User.Read.All"
107+
```
108+
105109
Run the following command:
106110

107111
```powershell
108-
Get-AzureADUser -Filter "UserType eq 'Guest'"
112+
Get-MgUser -Filter "UserType eq 'Guest'"
109113
```
110114

111115
You should see the users that you invited listed, with a user principal name (UPN) in the format *emailaddress*#EXT#\@*domain*. For example, *lstokes_fabrikam.com#EXT#\@contoso.onmicrosoft.com*, where contoso.onmicrosoft.com is the organization from which you sent the invitations.
112116

113117
## Clean up resources
114118

115-
When no longer needed, you can delete the test user accounts in the directory in the Azure portal on the Users page by selecting the checkbox next to the guest user and then selecting **Delete**.
119+
When no longer needed, you can delete the test user accounts in the directory in the Azure portal on the Users page by selecting the checkbox next to the guest user and then selecting **Delete**.
116120

117121
Or you can run the following PowerShell command to delete a user account:
118122

119123
```powershell
120-
Remove-AzureADUser -ObjectId "<UPN>"
124+
Remove-MgUser -UserId "<UPN>"
121125
```
122126

123-
For example: `Remove-AzureADUser -ObjectId "lstokes_fabrikam.com#EXT#@contoso.onmicrosoft.com"`
127+
For example: `Remove-MgUser -UserId "lstokes_fabrikam.com#EXT#@contoso.onmicrosoft.com"`
124128

125129
## Next steps
126130

0 commit comments

Comments
 (0)