Изменить

Поделиться через


Get-EntraUserOwnedObject

Get objects owned by a user.

Syntax

Get-EntraUserOwnedObject
   -UserId <String>
   [-All]
   [-Top <Int32>]
   [-Property <String[]>]
   [<CommonParameters>]

Description

The Get-EntraUserOwnedObject cmdlet gets objects owned by a user in Microsoft Entra ID. Specify UserId parameter to get objects owned by user.

Examples

Example 1: Get objects owned by a user

Connect-Entra -Scopes 'User.Read'
Get-EntraUserOwnedObject -UserId 'SawyerM@contoso.com' | 
Select-Object Id, displayName, createdDateTime, '@odata.type' |
Format-Table -AutoSize

id                                    displayName                  createdDateTime           @odata.type
--                                    -----------                  ---------------           -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb  Helpdesk Application         10/17/2024 5:05:54 AM     #microsoft.graph.application
bbbbbbbb-1111-2222-3333-cccccccccccc  Contoso Group                10/21/2024 6:25:19 PM     #microsoft.graph.group
cccccccc-2222-3333-4444-dddddddddddd  ClaimIssuancePolicy                                    #microsoft.graph.tokenLifetimePolicy
ffffffff-4444-5555-6666-gggggggggggg  Contoso Marketing App        10/23/2024 3:17:14 PM     #microsoft.graph.application

This example retrieves objects owned by the specified user.

  • -UserId Parameter specifies the ID of a user as a UserPrincipalName or UserId.

Example 2: Get all objects owned by a user

Connect-Entra -Scopes 'User.Read'
Get-EntraUserOwnedObject -UserId 'SawyerM@contoso.com' -All | 
Select-Object Id, displayName, createdDateTime, '@odata.type' |
Format-Table -AutoSize

id                                    displayName                  createdDateTime           @odata.type
--                                    -----------                  ---------------           -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb  Helpdesk Application         10/17/2024 5:05:54 AM     #microsoft.graph.application
bbbbbbbb-1111-2222-3333-cccccccccccc  Contoso Group                10/21/2024 6:25:19 PM     #microsoft.graph.group
cccccccc-2222-3333-4444-dddddddddddd  ClaimIssuancePolicy                                    #microsoft.graph.tokenLifetimePolicy
ffffffff-4444-5555-6666-gggggggggggg  Contoso Marketing App        10/23/2024 3:17:14 PM     #microsoft.graph.application

This example retrieves all the objects owned by the specified user.

  • -UserId parameter specifies the ID of a user as a UserPrincipalName or UserId.

Example 3: Get top three objects owned by a user

Connect-Entra -Scopes 'User.Read'
Get-EntraUserOwnedObject -UserId 'SawyerM@contoso.com' -Top 3 | 
Select-Object Id, displayName, createdDateTime, '@odata.type' |
Format-Table -AutoSize

id                                    displayName                  createdDateTime           @odata.type
--                                    -----------                  ---------------           -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb  Helpdesk Application         10/17/2024 5:05:54 AM     #microsoft.graph.application
bbbbbbbb-1111-2222-3333-cccccccccccc  Contoso Group                10/21/2024 6:25:19 PM     #microsoft.graph.group
cccccccc-2222-3333-4444-dddddddddddd  ClaimIssuancePolicy                                    #microsoft.graph.tokenLifetimePolicy

This example retrieves the top three objects owned by the specified user.

  • -UserId parameter specifies the ID of a user as a UserPrincipalName or UserId.

Parameters

-All

List all pages.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Property

Specifies properties to be returned.

Type:System.String[]
Aliases:Select
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Top

Specifies the maximum number of records to return.

Type:System.Int32
Aliases:Limit
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-UserId

Specifies the ID of a user (as a User Principal Name or UserId) in Microsoft Entra ID.

Type:System.String
Aliases:ObjectId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False