BackgroundÂ
The  Property parameter introduced in Version 0.10.0-preview allowed customers to select specific properties they would want to return in the response and is used in these 2 main scenarios: Â
- To request extra properties that are not returned by default.  Â
- To return a subset of the properties when the response returns a lot of properties by default (for performance reasons). Â
The scenarios above introduce a limitation where only the specified properties are returned, while the default properties are excluded from the response. Â
The AppendSelected switch parameter we shipped in version 1.0.12 solves this limitation by ensuring that the default properties are returned together with the specified properties. Â
ImplementationÂ
This parameter has been implemented in some Get-* cmdlets in the Microsoft.Entra.Users, Microsoft.Entra.Groups and Microsoft.Entra.Applications sub-modules.Â
UsageÂ
Install Entra PowerShell
Install-Module -Name Microsoft.Entra -RequiredVersion 1.0.12 -Repository PSGallery -Force -AllowClobberÂ
Note we are installing the version which we shipped this feature. All later versions should contain this feature.Â
Connect to the tenantÂ
We use the Connect-Entra cmdlet to connect to a Microsoft tenant. You pass all the required scopes.Â
We can start by invoking the command without the AppendSelected parameter.
Get-EntraGroup -GroupId 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' -Property IsManagementRestricted | Select-Object Id, DisplayName, MailEnabled, Visibility, IsManagementRestricted | Format-Table -AutoSize
Below is the output
Id                                   DisplayName                MailEnabled Visibility IsManagementRestricted
--                                   -----------                --------------- ---------- ----------
                            False
Since in our property selection we only selected IsManagementRestricted, some important properties are blank.
Let’s now invoke the command with the AppendSelected parameter.
Get-EntraGroup -GroupId 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' -Property IsManagementRestricted -AppendSelected | Select-Object Id, DisplayName, MailEnabled, Visibility, IsSubscribedByMail | Format-Table -AutoSize
Output
Id                                   DisplayName                MailEnabled Visibility IsManagementRestricted
--                                   -----------                --------------- ---------- ----------Â
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb SimpleGroup               False           Public     False
This example demonstrates how to append a selected property to the default properties. We have selected IsManagementRestricted property. Id, DisplayName, MailEnabled, Visibility are also returned.
SummaryÂ
This post demonstrates how we can use the AppendSelected parameter. This parameter is only available in a few Get-* cmdlets. With time, we will add the parameter to more cmdlets.Â
Kindly do not hesitate to leave your comments below or create github issues whenever you encounter an issue or you would like us to add the parameter to specific cmdlet(s).Â
0 comments
Be the first to start the discussion.