Edit

Share via


Get-EntraUserCreatedObject

Get objects created by the user.

Syntax

Default (Default)

Get-EntraUserCreatedObject

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

Description

The Get-EntraUserCreatedObject cmdlet retrieves directory objects created by a non-administrator user. Returns an empty object if the user has an admin role.

Examples

Example 1: Get a user-created object

Connect-Entra -Scopes 'User.Read','User.Read.All'
Get-EntraUserCreatedObject -UserId 'SawyerM@contoso.com' | Select-Object Id, DisplayName, '@odata.type'
Id                                   displayName    @odata.type
--                                   -----------    -----------
cccccccc-2222-3333-4444-dddddddddddd Contoso Group  #microsoft.graph.group

This example retrieves an object created by the specified user.

  • -UserId parameter specifies the object Id of a user(as a UserPrincipalName or UserId).

Example 2: Get all user-created objects

Connect-Entra -Scopes 'User.Read','User.Read.All'
Get-EntraUserCreatedObject -UserId 'SawyerM@contoso.com' -All | Select-Object Id, DisplayName, '@odata.type'
Id                                   displayName    @odata.type
--                                   -----------    -----------
cccccccc-2222-3333-4444-dddddddddddd Contoso Group  #microsoft.graph.group

This example retrieves all objects created by the specified user.

  • -UserId parameter specifies the object Id of a user(as a UserPrincipalName or UserId).

Example 3: Get a top one user-created object

Connect-Entra -Scopes 'User.Read','User.Read.All'
Get-EntraUserCreatedObject -UserId 'SawyerM@contoso.com' -Top 1 | Select-Object Id, DisplayName, '@odata.type'
Id                                   displayName    @odata.type
--                                   -----------    -----------
cccccccc-2222-3333-4444-dddddddddddd Contoso Group  #microsoft.graph.group

This example retrieves top one object created by the specified user. You can use -Limit as an alias for -Top.

  • -UserId parameter specifies the object Id of a user(as a UserPrincipalName or UserId).

Parameters

-All

List all pages.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Property

Specifies properties to be returned.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Select

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Top

Specifies the maximum number of records to return.

Parameter properties

Type:System.Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Limit

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-UserId

Specifies the ID (as a UserPrincipalName or UserId) of a user in Microsoft Entra ID.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ObjectId, UPN, Identity, UserPrincipalName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.