
· 2 min read
Retrieve Entra Agents with Microsoft 365 CLI
Over the past few months, there have been quite a few announcements around Microsoft Entra ID. One of the more exciting ones is the introduction of Agent ID a new identity type designed specifically to help you secure and manage your AI agents.
With this new identity type, something new is also possible: you can now retrieve an overview of all registered agents in your tenant using CLI for Microsoft 365. Quite useful when you want to see what’s active, or has been created ages ago.
As of now, you can run a single CLI for Microsoft 365 command to list all agents. Here’s the one I’m using:
m365 entra app list --query "[?contains(tags, 'AgenticInstance') || contains(tags, 'AgenticApp') || tags[?starts_with(@, 'power-virtual-agents-')]]"
As you can see it is comprised from three parts, so if you want to retrieve the older Power Virtual Agents agents, you can use the following command:
m365 entra app list --query "[?tags[?starts_with(@, 'power-virtual-agents-')]]"
And if you rather use Windows PowerShell, you can use the following command:
$apps = m365 entra app list --query "[?contains(tags, 'AgenticInstance') || contains(tags, 'AgenticApp') || tags[?starts_with(@, 'power-virtual-agents-')]]" | ConvertFrom-Json
$apps | FT DisplayName

As agents become more autonomous, managing them becomes more important. The combination of Agent ID and CLI for Microsoft 365 gives you control and visibility over your AI agents. So I have a new command in my toolkit to help me manage these agents effectively.

Albert-Jan Schot
CTO, Microsoft MVP & FastTrack Recognized Solution Architect
I am Albert-Jan Schot, CTO at Blis Digital, Microsoft MVP, and FastTrack Recognized Solution Architect focused on Microsoft 365, Azure, and AI agents. I help teams turn complex Microsoft Cloud challenges into practical architecture decisions and shipped outcomes.
Zuid Holland, Netherlands


