azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzureRmADServicePrincipal displays wrong property name (ObjectId instead of Id)

Open alpinemountain opened this issue 10 years ago • 3 comments

PSVersion 5.0.10586.494 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.10586.494 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Cmdlet(s)

Get-AzureRmADServicePrincipal

Module

AzureRM.Resources (version 3.2.0)

Description

Get-AzureRmADServicePrincipal returns an object, and displays the Id as "ObjectId". However, the ObjectId property is null. The "Id" property is the correct property. This is misleading

Example:

PS C:\temp> $uri="https://myuniqueappuri" PS C:\temp> $a=Get-AzureRmAdApplication -IdentifierUri $uri PS C:\temp> $p=Get-AzureRmADServicePrincipal -ServicePrincipalName $a.ApplicationId PS C:\temp> $p

DisplayName               Type                        **ObjectId**
-----------                    ----                           --------
https://myuniqueappuri         ServicePrincipal               fc9d30e0-0d1d-4ec6-a176-444555818b26

However, $p.ObjectId is null:

PS C:\temp> if (!$p.ObjectId) { Write-Host ("Value was null") } Value was null PS C:\temp>

"ObjectId" should be renamed to say "Id" in the above print out / string.

alpinemountain avatar Oct 12 '16 18:10 alpinemountain

@shuagarw Can you take a look?

markcowl avatar Oct 17 '16 19:10 markcowl

Same thing here, in the latest Powershell version.

BeardInASuit avatar Aug 02 '17 13:08 BeardInASuit

Fixed. Please reopen if you are still seeing this issue.

maddieclayton avatar Feb 07 '18 01:02 maddieclayton