-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-EntraUserSponsor review suggestions #1369
Open
SteveMutungi254
wants to merge
4
commits into
dbutoyi/user_sponsor
Choose a base branch
from
stevemutungi/user_sponsor
base: dbutoyi/user_sponsor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+102
−86
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,16 +56,14 @@ In delegated scenarios with work or school accounts, the signed-in user needs a | |
```powershell | ||
Connect-Entra -Scopes 'User.Read', 'User.Read.All' # User.Read.All is application-only permission (non-interactive login) | ||
Get-EntraBetaUserSponsor -UserId '[email protected]' | | ||
Select-Object Id, displayName, userPrincipalName, createdDateTime, accountEnabled, userType | | ||
Format-Table -AutoSize | ||
Select-Object Id, DisplayName, '@odata.type', CreatedDateTime | Format-Table -AutoSize | ||
``` | ||
|
||
```Output | ||
id displayName userPrincipalName createdDateTime accountEnabled userType | ||
-- ----------- ----------------- --------------- -------------- -------- | ||
c0c97c58-1895-4910-b1bb-58f96db771df Adele Vance [email protected] 28/10/2024 09:50:43 True Member | ||
79984fce-9e33-497a-a5a2-b3c85e3fedcb Alex Wilber [email protected] 28/10/2024 09:50:46 True Member | ||
406e3c9f-7a2d-4ef0-b1d4-69ddbd2719bb Diego Siciliani [email protected] 28/10/2024 09:50:46 True Member | ||
id displayName @odata.type createdDateTime | ||
-- ----------- ----------- --------------- | ||
cccccccc-2222-3333-4444-dddddddddddd Angel Brown #microsoft.graph.user 3/7/2024 3:10:31 AM | ||
eeeeeeee-4444-5555-6666-ffffffffffff Helpdesk Group #microsoft.graph.group 8/7/2024 2:52:47 PM | ||
``` | ||
|
||
This example shows how to list user sponsors. | ||
|
@@ -76,36 +74,39 @@ This example shows how to list user sponsors. | |
|
||
```powershell | ||
Connect-Entra -Scopes 'User.Read', 'User.Read.All' # User.Read.All is application-only permission (non-interactive login) | ||
Get-EntraBetaUserSponsor -UserId '[email protected]' -Top 1 | Select-Object Id, DisplayName, '@odata.type' | ||
Get-EntraBetaUserSponsor -UserId '[email protected]' -Top 1 | | ||
Select-Object Id, DisplayName, '@odata.type', CreatedDateTime | Format-Table -AutoSize | ||
``` | ||
|
||
```Output | ||
Id displayName @odata.type | ||
-- ----------- ----------- | ||
cccccccc-2222-3333-4444-dddddddddddd Contoso Group #microsoft.graph.group | ||
id displayName @odata.type createdDateTime | ||
-- ----------- ----------- --------------- | ||
cccccccc-2222-3333-4444-dddddddddddd Angel Brown #microsoft.graph.user 3/7/2024 3:10:31 AM | ||
``` | ||
|
||
This example retrieves the top sponsor for the specified user. | ||
This example retrieves the top sponsor for the specified user. You can use `-Limit` as an alias for `-Top`. | ||
|
||
- The `-UserId` parameter specifies the User ID or User Principal Name. | ||
|
||
### Example 3: Retrieve the assigned sponsor for a specific user by their SponsorId | ||
|
||
```powershell | ||
Connect-Entra -Scopes 'User.Read', 'User.Read.All' # User.Read.All is application-only permission (non-interactive login) | ||
Get-EntraBetaUserSponsor -UserId '[email protected]' -SponsorId c0c97c58-1895-4910-b1bb-58f96db771df | Select-Object Id, DisplayName, '@odata.type' | ||
Get-EntraBetaUserSponsor -UserId '[email protected]' -SponsorId 'cccccccc-2222-3333-4444-dddddddddddd' | | ||
Select-Object Id, DisplayName, '@odata.type', CreatedDateTime | Format-Table -AutoSize | ||
``` | ||
|
||
```Output | ||
Id displayName @odata.type | ||
-- ----------- ----------- | ||
cccccccc-2222-3333-4444-dddddddddddd Contoso Group #microsoft.graph.group | ||
id displayName @odata.type createdDateTime | ||
-- ----------- ----------- --------------- | ||
cccccccc-2222-3333-4444-dddddddddddd Angel Brown #microsoft.graph.user 3/7/2024 3:10:31 AM | ||
eeeeeeee-4444-5555-6666-ffffffffffff Helpdesk Group #microsoft.graph.group 8/7/2024 2:52:47 PM | ||
``` | ||
|
||
This example retrieves the assigned sponsor for the specified user. | ||
|
||
- The `-UserId` parameter specifies the User ID or User Principal Name. | ||
- The `-SponsorId` parameter specifies the specific user's sponsor ID to retrieve. | ||
- The `-SponsorId` parameter specifies the specific user's sponsor ID to retrieve (user or group ID). | ||
|
||
## Parameters | ||
|
||
|
@@ -140,6 +141,21 @@ Accept pipeline input: True (ByPropertyName, ByValue) | |
Accept wildcard characters: False | ||
``` | ||
### -SponsorId | ||
Specifies the specific user's sponsor ID to retrieve (user or group ID). | ||
```yaml | ||
Type: System.String | ||
Parameter Sets: (All) | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: True (ByPropertyName, ByValue) | ||
Accept wildcard characters: False | ||
``` | ||
### -Top | ||
Specifies the maximum number of records to return. | ||
|
@@ -182,4 +198,4 @@ This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar | |
|
||
## Notes | ||
|
||
## Related Links | ||
## Related Links |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,16 +56,14 @@ In delegated scenarios with work or school accounts, the signed-in user needs a | |
```powershell | ||
Connect-Entra -Scopes 'User.Read', 'User.Read.All' # User.Read.All is application-only permission (non-interactive login) | ||
Get-EntraUserSponsor -UserId '[email protected]' | | ||
Select-Object Id, displayName, userPrincipalName, createdDateTime, accountEnabled, userType | | ||
Format-Table -AutoSize | ||
Select-Object Id, DisplayName, '@odata.type', CreatedDateTime | Format-Table -AutoSize | ||
``` | ||
|
||
```Output | ||
id displayName userPrincipalName createdDateTime accountEnabled userType | ||
-- ----------- ----------------- --------------- -------------- -------- | ||
c0c97c58-1895-4910-b1bb-58f96db771df Adele Vance [email protected] 28/10/2024 09:50:43 True Member | ||
79984fce-9e33-497a-a5a2-b3c85e3fedcb Alex Wilber [email protected] 28/10/2024 09:50:46 True Member | ||
406e3c9f-7a2d-4ef0-b1d4-69ddbd2719bb Diego Siciliani [email protected] 28/10/2024 09:50:46 True Member | ||
id displayName @odata.type createdDateTime | ||
-- ----------- ----------- --------------- | ||
cccccccc-2222-3333-4444-dddddddddddd Angel Brown #microsoft.graph.user 3/7/2024 3:10:31 AM | ||
eeeeeeee-4444-5555-6666-ffffffffffff Helpdesk Group #microsoft.graph.group 8/7/2024 2:52:47 PM | ||
``` | ||
|
||
This example shows how to list user sponsors. | ||
|
@@ -76,36 +74,39 @@ This example shows how to list user sponsors. | |
|
||
```powershell | ||
Connect-Entra -Scopes 'User.Read', 'User.Read.All' # User.Read.All is application-only permission (non-interactive login) | ||
Get-EntraUserSponsor -UserId '[email protected]' -Top 1 | Select-Object Id, DisplayName, '@odata.type' | ||
Get-EntraUserSponsor -UserId '[email protected]' -Top 1 | | ||
Select-Object Id, DisplayName, '@odata.type', CreatedDateTime | Format-Table -AutoSize | ||
``` | ||
|
||
```Output | ||
Id displayName @odata.type | ||
-- ----------- ----------- | ||
cccccccc-2222-3333-4444-dddddddddddd Contoso Group #microsoft.graph.group | ||
id displayName @odata.type createdDateTime | ||
-- ----------- ----------- --------------- | ||
cccccccc-2222-3333-4444-dddddddddddd Angel Brown #microsoft.graph.user 3/7/2024 3:10:31 AM | ||
``` | ||
|
||
This example retrieves the top sponsor for the specified user. | ||
This example retrieves the top sponsor for the specified user. You can use `-Limit` as an alias for `-Top`. | ||
|
||
- The `-UserId` parameter specifies the User ID or User Principal Name. | ||
|
||
### Example 3: Retrieve the assigned sponsor for a specific user by their SponsorId | ||
|
||
```powershell | ||
Connect-Entra -Scopes 'User.Read', 'User.Read.All' # User.Read.All is application-only permission (non-interactive login) | ||
Get-EntraUserSponsor -UserId '[email protected]' -SponsorId cccccccc-2222-3333-4444-dddddddddddd | Select-Object Id, DisplayName, '@odata.type' | ||
Get-EntraUserSponsor -UserId '[email protected]' -SponsorId 'cccccccc-2222-3333-4444-dddddddddddd' | | ||
Select-Object Id, DisplayName, '@odata.type', CreatedDateTime | Format-Table -AutoSize | ||
``` | ||
|
||
```Output | ||
Id displayName @odata.type | ||
-- ----------- ----------- | ||
cccccccc-2222-3333-4444-dddddddddddd Contoso Group #microsoft.graph.group | ||
id displayName @odata.type createdDateTime | ||
-- ----------- ----------- --------------- | ||
cccccccc-2222-3333-4444-dddddddddddd Angel Brown #microsoft.graph.user 3/7/2024 3:10:31 AM | ||
eeeeeeee-4444-5555-6666-ffffffffffff Helpdesk Group #microsoft.graph.group 8/7/2024 2:52:47 PM | ||
``` | ||
|
||
This example retrieves the assigned sponsor for the specified user. | ||
|
||
- The `-UserId` parameter specifies the User ID or User Principal Name. | ||
- The `-SponsorId` parameter specifies the specific user's sponsor ID to retrieve. | ||
- The `-SponsorId` parameter specifies the specific user's sponsor ID to retrieve (user or group ID). | ||
|
||
## Parameters | ||
|
||
|
@@ -140,6 +141,21 @@ Accept pipeline input: True (ByPropertyName, ByValue) | |
Accept wildcard characters: False | ||
``` | ||
### -SponsorId | ||
Specifies the specific user's sponsor ID to retrieve (user or group ID). | ||
```yaml | ||
Type: System.String | ||
Parameter Sets: (All) | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: True (ByPropertyName, ByValue) | ||
Accept wildcard characters: False | ||
``` | ||
### -Top | ||
Specifies the maximum number of records to return. | ||
|
@@ -182,4 +198,4 @@ This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar | |
|
||
## Notes | ||
|
||
## Related Links | ||
## Related Links |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this comment.
Connect-Entra -Scopes
is an interactive login.Also, it doesn't make sense to specify 'User.Read' and 'User.Read.All' at the same time.