You manage 100 Azure virtual machines that have system-assigned managed identities. You must obtain the objectId value for each managed identity. Which command should you run?
Choose an answer
Tap an option to check your answer.
Correct answer: Get-AzResource.
Why this is the answer
The Get-AzResource cmdlet is the correct choice because it retrieves Azure resources, and managed identities are a type of Azure resource. You can filter by resource type Microsoft.ManagedIdentity/userAssignedIdentities or Microsoft.Compute/virtualMachines (and then expand the identity property) to find the objectId. Get-AzureADUser is incorrect as it retrieves Azure Active Directory user objects, not managed identities. Get-AzureADUserOwnedObject retrieves objects owned by a specific user, which isn't directly applicable to finding system-assigned managed identities. az ad signed-in-user list-owned-objects is a CLI command, not a PowerShell cmdlet, and also focuses on objects owned by the signed-in user, not all managed identities.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed