You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Get-EntraUserExtension cmdlet isn't as user friendly as the old Get-AzureADUserExtension was.
Description
With Get-EntraUserExtension I need to force the output of the extension by explicitly calling the attribute name, which requires me to know the attribute name first.
It behaves the same way as the Get-EntraUser without any value added.
What if I don't know the Extension attribute name? - Here's what I need to do with some creativity (not sure if this is the best way though):
$userID='cabb1187-6885-45ee-879b-d87ff47213e9'
[string] $extensions="Id,UserPrincipalName,"$extensions+= (Get-MgDirectoryObjectAvailableExtensionProperty|Where-Object {$_.IsSyncedFromOnPremises-eq$true} |Select-Object-ExpandProperty Name) -join','
[string] $baseUri='https://graph.microsoft.com/v1.0/users/'
[string] $uri=$baseUri+$userID+'?$select='+$extensionsInvoke-MgGraphRequest-Method GET -Uri $uri| ft Name,Value
Result
Name Value
---- -----
userPrincipalName SyncedUserCloudMbx1@Contoso.com
id cabb1187-6885-45ee-879b-d87ff47213e9
extension_2a9d32bee4ce4b8a8152c9f73c96924d_gidNumber 1234
@odata.context https://graph.microsoft.com/v1.0/$metadata#users(id,userPrincipalName,extension_2a9d32bee4ce4b8a8152c9f73c96924d_nuAlexStringTest,extension_2a9d32bee4ce4b8a8152c9f73c96924d_nuAlexStringMultiValued,e…
Expected behavior
The cmdlet should output the extension properties the object have, by default and having to specify the attribute name.
Summary
The
Get-EntraUserExtension
cmdlet isn't as user friendly as the oldGet-AzureADUserExtension
was.Description
With
Get-EntraUserExtension
I need to force the output of the extension by explicitly calling the attribute name, which requires me to know the attribute name first.It behaves the same way as the
Get-EntraUser
without any value added.Reproduce
Steps to reproduce the behavior:
Get-EntraUserExtension
for a user:Result - No extension attribute is returned:
Get-EntraUserExtension
for a user, but specifying an extension attribute:Result - Extension attribute is returned:
Get-EntraUser
cmdlet can produce the same output, which defeats the purpose of having aGet-EntraUserExtension
in first place:Result - Extension attribute is returned:
Result
Expected behavior
The cmdlet should output the extension properties the object have, by default and having to specify the attribute name.
Debug Output
Debug Output
Module Version
Environment Data
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: