Get-MsIdAgentIdentity
SYNOPSIS
Gets an Agent Identity by its ID
SYNTAX
Get-MsIdAgentIdentity [-AgentId] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Retrieves an Agent Identity from Microsoft Graph using the provided Agent ID. Returns the agent identity object if found, or throws an error if not found.
EXAMPLES
EXAMPLE 1
Get-MsIdAgentIdentity -AgentId "27a3cf14-5bdc-4814-bb13-8f1740ca9a4f"
EXAMPLE 2
try {
$agent = Get-MsIdAgentIdentity -AgentId "27a3cf14-5bdc-4814-bb13-8f1740ca9a4f"
Write-Host "Agent found: $($agent.displayName)"
} catch {
Write-Host "Agent not found or error occurred: $_"
}
PARAMETERS
-AgentId
The ID of the Agent Identity to retrieve.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.