{"id":51,"date":"2025-12-01T18:00:52","date_gmt":"2025-12-02T02:00:52","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/entrapowershell\/?p=51"},"modified":"2025-12-01T22:43:14","modified_gmt":"2025-12-02T06:43:14","slug":"appendselected-parameter","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/entrapowershell\/appendselected-parameter\/","title":{"rendered":"AppendSelected parameter"},"content":{"rendered":"<h2 aria-level=\"2\"><span data-contrast=\"none\">Background<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">The\u202f <\/span><b><span data-contrast=\"auto\">Property<\/span><\/b><span data-contrast=\"auto\">\u202fparameter introduced in Version\u202f<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/entra-powershell\/releases\/tag\/0.10.0-preview\"><b><span data-contrast=\"none\">0.10.0-preview<\/span><\/b><\/a><span data-contrast=\"auto\"> allowed customers to select specific properties they would want to return in the response and is used in these 2 main scenarios:<\/span><span data-contrast=\"auto\">\u202f<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><\/p>\n<ol>\n<li><span data-contrast=\"auto\">To request extra properties that are not returned by default.\u202f<\/span><span data-contrast=\"auto\">\u202f<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">To return a subset of the properties when the response returns\u202fa lot\u202fof properties by default\u202f(for performance reasons).<\/span><span data-contrast=\"auto\">\u202f<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<\/ol>\n<p><span data-contrast=\"auto\">The scenarios above introduce a limitation where only the\u202fspecified properties are\u202freturned,\u202fwhile the default properties are excluded from the response.<\/span><span data-contrast=\"auto\">\u202f<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The<\/span><b><span data-contrast=\"auto\"> AppendSelected<\/span><\/b><span data-contrast=\"auto\">\u202fswitch\u202fparameter we shipped in version <\/span><a href=\"https:\/\/github.com\/microsoftgraph\/entra-powershell\/releases\/tag\/1.0.12\"><b><span data-contrast=\"none\">1.0.12<\/span><\/b><\/a> <span data-contrast=\"auto\">solves this limitation by ensuring that the default properties are returned together with the specified properties.<\/span><span data-contrast=\"auto\">\u202f<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"2\"><span data-contrast=\"none\">Implementation<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">This parameter has been implemented in some Get-* cmdlets in the <\/span><a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/module\/microsoft.entra.users\"><span data-contrast=\"none\">Microsoft.Entra.Users<\/span><\/a><span data-contrast=\"auto\">, <\/span><a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/module\/microsoft.entra.groups\"><span data-contrast=\"none\">Microsoft.Entra.Groups<\/span><\/a><span data-contrast=\"auto\"> and <\/span><a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/module\/microsoft.entra.applications\"><span data-contrast=\"none\">Microsoft.Entra.Applications<\/span><\/a><span data-contrast=\"auto\"> sub-modules.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"2\"><span data-contrast=\"none\">Usage<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<h3 aria-level=\"3\"><span data-contrast=\"none\">Install Entra PowerShell<\/span><code class=\"language-cs language-csharp\"><\/code><\/h3>\n<pre aria-level=\"3\"><span data-contrast=\"auto\">Install-Module -Name Microsoft.Entra -RequiredVersion 1.0.12 -Repository PSGallery -Force -AllowClobber<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<p><span data-ccp-props=\"{}\">Note we are installing the version which we shipped this feature. All later versions should contain this feature.\u00a0<\/span><\/p>\n<h3 aria-level=\"3\"><span data-contrast=\"none\">Connect to the tenant<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">We use the <\/span><a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/module\/microsoft.entra.authentication\/connect-entra\"><span data-contrast=\"none\">Connect-Entra<\/span><\/a><span data-contrast=\"auto\"> cmdlet to connect to a Microsoft tenant. You pass all the required scopes.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p>We can start by invoking the command without the <strong>AppendSelected<\/strong> parameter.<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">Get-EntraGroup -GroupId 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' -Property IsManagementRestricted | Select-Object Id, DisplayName, MailEnabled, Visibility, IsManagementRestricted | Format-Table -AutoSize<\/code><\/pre>\n<p aria-level=\"3\">Below is the output<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">Id \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f DisplayName \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202fMailEnabled     Visibility IsManagementRestricted \r\n\r\n-- \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f ----------- \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f--------------- ----------  ----------             \r\n\r\n  \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f  \u202f \u202f                                                              False                  <\/code><\/pre>\n<p aria-level=\"3\">Since in our property selection we only selected <strong>IsManagementRestricted<\/strong>, some important properties are blank.<\/p>\n<p aria-level=\"3\"><span data-contrast=\"none\">Let&#8217;s now invoke the command with the <strong>AppendSelected<\/strong> parameter.<\/span><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">Get-EntraGroup -GroupId 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' -Property IsManagementRestricted -AppendSelected | Select-Object Id, DisplayName, MailEnabled, Visibility, IsSubscribedByMail | Format-Table -AutoSize <\/code><\/pre>\n<p><span data-contrast=\"auto\">Output<\/span><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">Id \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f DisplayName \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202fMailEnabled     Visibility IsManagementRestricted \r\n\r\n-- \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f ----------- \u202f \u202f \u202f \u202f \u202f \u202f \u202f \u202f--------------- ---------- ----------\u00a0            \r\n\r\naaaaaaaa-0000-1111-2222-bbbbbbbbbbbb SimpleGroup \u202f \u202f \u202f \u202f \u202f \u202f \u202f  False \u202f \u202f \u202f \u202f \u202f  Public \u202f \u202f False                 <\/code><\/pre>\n<p><span data-contrast=\"auto\">This example demonstrates how to append a selected property to the default properties.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><span data-ccp-props=\"{}\"> We have selected <code class=\"language-default\">IsManagementRestricted<\/code> property. Id, DisplayName, MailEnabled, Visibility are also returned.<\/span><\/p>\n<h2 aria-level=\"2\"><span data-contrast=\"none\">Summary<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">This post demonstrates how we can use the\u00a0 <strong>AppendSelected<\/strong> parameter. This parameter is only available in a few Get-* cmdlets. With time, we will add the parameter to more cmdlets.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Kindly do not hesitate to leave your comments below or <\/span><a href=\"https:\/\/github.com\/microsoftgraph\/entra-powershell\/issues\"><span data-contrast=\"none\">create github issues<\/span><\/a><span data-contrast=\"auto\"> whenever you encounter an issue or you would like us to add the parameter to specific cmdlet(s).<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Background\u00a0 The\u202f Property\u202fparameter introduced in Version\u202f0.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:\u202f\u00a0 To request extra properties that are not returned by default.\u202f\u202f\u00a0 To return a subset of the properties when the response returns\u202fa lot\u202fof properties by default\u202f(for performance reasons).\u202f\u00a0 [&hellip;]<\/p>\n","protected":false},"author":20598,"featured_media":10,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-entra-powershell"],"acf":[],"blog_post_summary":"<p>Background\u00a0 The\u202f Property\u202fparameter introduced in Version\u202f0.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:\u202f\u00a0 To request extra properties that are not returned by default.\u202f\u202f\u00a0 To return a subset of the properties when the response returns\u202fa lot\u202fof properties by default\u202f(for performance reasons).\u202f\u00a0 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/users\/20598"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/media\/10"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/entrapowershell\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}