Skip to content

Commit 587c088

Browse files
Changed to use -Select
1 parent 26fa4c5 commit 587c088

3 files changed

Lines changed: 34 additions & 24 deletions

File tree

module/Entra/Microsoft.Entra/Users/Update-EntraInvitedUserSponsorsFromInvitedBy.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ function Update-EntraInvitedUserSponsorsFromInvitedBy {
3333
}
3434

3535
if ($All) {
36-
$invitedUsers = Get-EntraUser -Filter $guestFilter -All -ExpandProperty Sponsors
36+
$invitedUsers = Get-EntraUser -Filter $guestFilter -All -Select Sponsors
3737
}
3838
else {
3939
foreach ($user in $UserId) {
40-
$invitedUsers += Get-EntraUser -UserId $user -ExpandProperty Sponsors
40+
$invitedUsers += Get-EntraUser -UserId $user -Select Sponsors
4141
}
4242
}
4343

module/docs/entra-powershell-beta/Users/Update-EntraBetaInvitedUserSponsorsFromInvitedBy.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ ms.reviewer: stevemutungi
99
manager: CelesteDG
1010
author: msewaweru
1111

12-
external help file: Microsoft.Entra.Users-Help.xml
13-
Module Name: Microsoft.Entra
14-
online version: https://learn.microsoft.com/powershell/module/Microsoft.Entra/Update-EntraBetaInvitedUserSponsorsFromInvitedBy
12+
external help file: Microsoft.Entra.Beta.Users-Help.xml
13+
Module Name: Microsoft.Entra.Beta
14+
online version: https://learn.microsoft.com/powershell/module/Microsoft.Beta.Entra/Update-EntraBetaInvitedUserSponsorsFromInvitedBy
1515

1616
schema: 2.0.0
1717
---
@@ -20,7 +20,7 @@ schema: 2.0.0
2020

2121
## Synopsis
2222

23-
Updates the sponsors of invited users based on the user who invited them.
23+
Update the Sponsors attribute to include the user who initially invited them to the tenant using the InvitedBy property.
2424

2525
## Syntax
2626

@@ -33,7 +33,7 @@ Update-EntraBetaInvitedUserSponsorsFromInvitedBy
3333

3434
## Description
3535

36-
The `Update-EntraBetaInvitedUserSponsorsFromInvitedBy` cmdlet updates the sponsors for invited users based on the inviter's information in Microsoft Entra ID.
36+
The `Update-EntraBetaInvitedUserSponsorsFromInvitedBy` cmdlet updates the Sponsors attribute to include the user who initially invited them to the tenant using the InvitedBy property. This script can be used to backfill Sponsors attribute for existing users.
3737

3838
The calling user must be assigned at least one of the following Microsoft Entra roles:
3939

@@ -42,16 +42,25 @@ The calling user must be assigned at least one of the following Microsoft Entra
4242

4343
## Examples
4444

45-
### Example 1: Update sponsors for a specific guest user
45+
### Example 1: Enumerate all invited users in the Tenant and update Sponsors using InvitedBy value
46+
47+
```powershell
48+
Connect-Entra -Scopes 'User.ReadWrite.All'
49+
Update-EntraBetaInvitedUserSponsorsFromInvitedBy
50+
```
51+
52+
Enumerate all invited users in the Tenant and update Sponsors using InvitedBy value
53+
54+
### Example 2: Update sponsors for a specific guest user
4655

4756
```powershell
4857
Connect-Entra -Scopes 'User.ReadWrite.All'
49-
Update-EntraBetaInvitedUserSponsorsFromInvitedBy -UserId 'guestuser@contoso.com'
58+
Update-EntraBetaInvitedUserSponsorsFromInvitedBy -UserId 'guestuser@contoso.com','guestuser1@contoso.com'
5059
```
5160

5261
This command updates the sponsors for the specified guest user in Microsoft Entra ID.
5362

54-
### Example 2: Update sponsors for all invited guest users
63+
### Example 3: Update sponsors for all invited guest users
5564

5665
```powershell
5766
Connect-Entra -Scopes 'User.ReadWrite.All'
@@ -100,12 +109,8 @@ This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar
100109

101110
## Inputs
102111

103-
None.
104-
105112
## Outputs
106113

107-
None.
108-
109114
## Notes
110115

111116
- If neither `-UserId` nor `-All` is specified, the cmdlet returns an error.

module/docs/entra-powershell-v1.0/Users/Update-EntraInvitedUserSponsorsFromInvitedBy.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Update-EntraInvitedUserSponsorsFromInvitedBy
33
description: This article provides details on the Update-EntraInvitedUserSponsorsFromInvitedBy command.
44

55
ms.topic: reference
6-
ms.date: 06/26/2024
6+
ms.date: 02/11/2025
77
ms.author: eunicewaweru
88
ms.reviewer: stevemutungi
99
manager: CelesteDG
@@ -20,7 +20,7 @@ schema: 2.0.0
2020

2121
## Synopsis
2222

23-
Updates the sponsors of invited users based on the user who invited them.
23+
Update the Sponsors attribute to include the user who initially invited them to the tenant using the InvitedBy property.
2424

2525
## Syntax
2626

@@ -33,7 +33,7 @@ Update-EntraInvitedUserSponsorsFromInvitedBy
3333

3434
## Description
3535

36-
The `Update-EntraInvitedUserSponsorsFromInvitedBy` cmdlet updates the sponsors for invited users based on the inviter's information in Microsoft Entra ID.
36+
The `Update-EntraInvitedUserSponsorsFromInvitedBy` cmdlet updates the Sponsors attribute to include the user who initially invited them to the tenant using the InvitedBy property. This script can be used to backfill Sponsors attribute for existing users.
3737

3838
The calling user must be assigned at least one of the following Microsoft Entra roles:
3939

@@ -42,16 +42,25 @@ The calling user must be assigned at least one of the following Microsoft Entra
4242

4343
## Examples
4444

45-
### Example 1: Update sponsors for a specific guest user
45+
### Example 1: Enumerate all invited users in the Tenant and update Sponsors using InvitedBy value
46+
47+
```powershell
48+
Connect-Entra -Scopes 'User.ReadWrite.All'
49+
Update-EntraInvitedUserSponsorsFromInvitedBy
50+
```
51+
52+
Enumerate all invited users in the Tenant and update Sponsors using InvitedBy value
53+
54+
### Example 2: Update sponsors for a specific guest user
4655

4756
```powershell
4857
Connect-Entra -Scopes 'User.ReadWrite.All'
49-
Update-EntraInvitedUserSponsorsFromInvitedBy -UserId 'guestuser@contoso.com'
58+
Update-EntraInvitedUserSponsorsFromInvitedBy -UserId 'guestuser@contoso.com','guestuser1@contoso.com'
5059
```
5160

5261
This command updates the sponsors for the specified guest user in Microsoft Entra ID.
5362

54-
### Example 2: Update sponsors for all invited guest users
63+
### Example 3: Update sponsors for all invited guest users
5564

5665
```powershell
5766
Connect-Entra -Scopes 'User.ReadWrite.All'
@@ -100,12 +109,8 @@ This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar
100109

101110
## Inputs
102111

103-
None.
104-
105112
## Outputs
106113

107-
None.
108-
109114
## Notes
110115

111116
- If neither `-UserId` nor `-All` is specified, the cmdlet returns an error.

0 commit comments

Comments
 (0)