Get-AzureRmADServicePrincipal displays wrong property name (ObjectId instead of Id)
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.
@shuagarw Can you take a look?
Same thing here, in the latest Powershell version.
Fixed. Please reopen if you are still seeing this issue.