Object owners in Microsoft Entra ultimately have full control over that object, so it is important to be vigilant and retain constant visibility over who owns what object in your directory, whether a group, application or service principal and also to ensure you understand the impact of any changes to the objects.
In this article, I will show you how to use Microsoft Graph PowerShell to identify which objects in Microsoft Entra a user owns.
Why do object owners matter in Microsoft Entra?
Well, take security groups for example, a standard user would not be able to modify groups that they are not the owner of, however, they would be able to modify the membership and delete a group that they are the owner of, even without an admin role assigned.
This poses many risks, but here is an example: What if a security group created by a standard user was repurposed and used for assignment to a critical Conditional Access policy?
So, imagine the leader of your marketing team created a security group to assign his team to a folder he created in SharePoint. They then needed additional security assigned to the marketing team, so IT created a new Conditional Access policy and assigned it to the existing security group for simplicity. Now if the marketing lead removed a user from the group, or deleted the group, the Conditional Access policy would no longer apply.
It’s a similar story for applications, say a standard user created an application for a new piece of software that they needed to sign in using their work email address. The software vendor advised admin consent for the user.readwrite.all permissions were required in the app-only context for the app to function (this would be overkill for the application to support user login, but the vendor insists, so IT grants it). The user can now sign in to the application in the delegated context, without the ability to modify any user account. However, the application owner could elevate themselves to the app-only context, giving them the ability to modify any user account in the organisation, even without being assigned an admin role.
Requirements
To run the commands in this article, you must ensure that you have the latest version of the Microsoft Graph PowerShell modules installed and a Global Administrator user to consent to the directory.read.all permission.
For more information check out these articles:
- How To Install the Microsoft Graph PowerShell Module
- How To Find Permissions For Microsoft Graph PowerShell
Once you have met these requirements, you can connect to Microsoft Graph with the following command.
Connect-MgGraph -Scope Directory.Read.All Script to list all directory objects owned by a user in Microsoft Entra
While there is a command built into the Microsoft Graph PowerShell module by default (Get-MgBetaUserOwnedObject), the data it retrieves is structured poorly, rendering it useless. Instead, I have written this small function that will give you a clear view of which objects a user owns, including the object name, object type and object ID. This information can be used to help further determine if ownership over this object can be removed or must be retained.
function Get-OcnMgOwnedObject {
param(
$userid
)
$response = invoke-MgGraphRequest -uri "https://graph.microsoft.com/beta/users/$userid/ownedObjects" -OutputType PSObject | Select -ExpandProperty Value
$report = [System.Collections.Generic.List[Object]]::new()
forEach ($item in $response) {
switch ($item.'@odata.type')
{
'#microsoft.graph.group' { $type = 'Group' }
'#microsoft.graph.application' { $type = 'Application' }
'#microsoft.graph.servicePrincipal' { $type = 'Service Principal' }
}
$obj = [PSCustomObject][ordered]@{
"Type" = $type
"Display Name" = $item.DisplayName
"Object Id" = $item.id
}
$report.Add($obj)
}
$report
} Once you have run the above function in your PowerShell terminal, the function will be ready to use. Run the following command, entering the username of your target user.
Get-OcnMgOwnedObject -userid [email protected] If owned objects are found, then your output should look something like this:

