The Get-MgUserCreatedObject cmdlet in PowerShell gets the directory objects that are created by a user. It is a read-only and nullable.
To use the Get-MgUserCreatedObject cmdlet, you must first connect to your Microsoft 365 tenant using the
Connect-MGraph cmdlet. Once you are connected, you can use the Get-MgUserCreatedObject cmdlet.
The syntax to get mg user-created object in PowerShell is given below.
Get-MgUserCreatedObject -UserId <String> -DirectoryObjectId <String> [-ExpandProperty <String>] [-Property <String>] [-Filter <String>] [-Search <String>] [-Skip <Int32>] [-Sort <String>] [-Top <Int32>] [-PageSize <Int32>] [-All] [-CountVariable <String>] [<CommonParameters>]
In this article, we will discuss how to use the Get-MgUserCreatedObject cmdlet in PowerShell to find the directory objects that are created by a specific user.
How to Get a List of Directory Objects Created by User
To get a list of directory objects that were created by a user in Microsoft Graph, run the following command.
Get-MgUserCreatedObject -UserId 'cf634aac-d7d1-41a4-aad9-544c0bfda070'
This command gets a list of all directory objects that have been created by the specified user.
I hope the above article on how to use the Get-MgUserCreatedObject cmdlet in PowerShell to get the directory objects created by a user is helpful to you.
This works for a user who isn’t in any administrator role.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.