{"id":534,"date":"2009-12-16T10:29:03","date_gmt":"2009-12-16T15:29:03","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/2009\/12\/appending-property-values-in-powershell\/"},"modified":"2009-12-16T10:29:03","modified_gmt":"2009-12-16T15:29:03","slug":"appending-property-values-in-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/","title":{"rendered":"Appending Property Values in PowerShell"},"content":{"rendered":"<p>This morning I helped out a fellow scripter in the PowerShell forum at <a href=\"http:\/\/www.scriptinganswers.com\/\" target=\"_blank\">ScriptingAnswers.com<\/a>. He was trying to figure out an Exchange 2007 problem. He wanted to update a property value, but keep the existing property values. This seems a like a reasonable request and one that isn\u2019t limited to Exchange. There are plenty of objects you might work with in PowerShell where you want to keep the existing property value and add to it. My solution is specific to the Exchange problem, but I think you could use it as a model for similar problems with other objects.<\/p>\n<p> <!--more-->  <\/p>\n<p>In Exchange you can grant SendOnBehalf privileges for a mailbox using the Set-Mailbox cmdlet and the \u2013GrantSendOnBehalfTo parameter.<\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">PS C:\\&gt; get-mailbox jeff | set-mailbox \u2013grantSendOnBehalfto beth<\/font><\/p>\n<p>This will add the user \u201cbeth\u201d the appropriate privilege. The parameter requires a mailbox identity string like the user \u2018s SAMAccountname or distinguishedname. The Jeff mailbox\u2019s GrantSendOnBehalfTo property is now an ADInfo object with its own set of properties. The Set-Mailbox cmdlet also lets you specify multiple values for this parameter.<\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">PS C:\\&gt; get-mailbox jeff | set-mailbox \u2013grantSendOnBehalfto beth,lucky<\/font><\/p>\n<p>The challenge was to keep the existing values. Here\u2019s the solution I offered.<\/p>\n<div style=\"border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 10pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px\" id=\"codeSnippetWrapper\">\n<div style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\" id=\"codeSnippet\">\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum1\">   1:<\/span> get-mailbox test.user24 | <span style=\"color: #0000ff\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum2\">   2:<\/span>   $a=@() <\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum3\">   3:<\/span>   <span style=\"color: #008000\">#enumerate existing values<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum4\">   4:<\/span>   <span style=\"color: #0000ff\">foreach<\/span> ($granted <span style=\"color: #0000ff\">in<\/span> $_.GrantSendOnBehalfTo) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum5\">   5:<\/span>     $a+=$granted.distinguishedname<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum6\">   6:<\/span>   }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum7\">   7:<\/span>   <span style=\"color: #008000\">#add the new user <\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum8\">   8:<\/span>   $a+=<span style=\"color: #006080\">&quot;fflintstone&quot;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum9\">   9:<\/span>&#160; <\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum10\">  10:<\/span>   $_ | set-mailbox -grantSendonBehalfTo $a<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\"><span style=\"color: #606060\" id=\"lnum11\">  11:<\/span> }<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>I\u2019m doing this for a single mailbox, but it it would work for a collection as well. The trick, if you will, is that you need to work with each mailbox individually so I pipe the mailbox to ForEach on Line 1.<\/p>\n<p>Because the Set-Mailbox cmdlet has no way to append properties, I need to save the existing values for the GrantSendonBehalfTo property. To accomplish this I\u2019ll initialize and empty array in Line 2. The property may have a collection of values or objects, so I need to enumerate each one as I do on Line 3. Remember, in this case each property value is an embedded object. I want to save the distinguishedname of each embedded object to the array (Line 5). Finally I need to add the name of the new user I want (Line 8). I can keep it simple by using the SAMAccountname. All that remains is to set the property using Set-Mailbox, using the array as the value. The cmdlet handles parsing the array accordingly. This works because the \u2013GrantSendonBehalfTo parameter accepts arrays.<\/p>\n<div style=\"border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 10pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px\" id=\"codeSnippetWrapper\">\n<div style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\" id=\"codeSnippet\">\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">-GrantSendOnBehalfTo &lt;MailboxOrMailUserIdParameter[]&gt;<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">    The GrantSendOnBehalfTo parameter specifies the distinguished name (DN)<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">     of other mailboxes that can send messages on behalf of this mailbox.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">    Required?                    false<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">    Position?                    Named<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">    Default value                Null<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">    Accept pipeline input?       False<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px\">    Accept wildcard characters?  false<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>I can tell from reading the help that the is looking for a MailboxOrMailUserIDParameter and the {} indicates it can accept an a array of them.<\/p>\n<p>When I look at the mailboxes GrantSendonBehalfTo property I have the previously set values plus my new one.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/grantsendonbehalfto.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto\" title=\"grantsendonbehalfto\" border=\"0\" alt=\"grantsendonbehalfto\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/grantsendonbehalfto_thumb.png\" width=\"484\" height=\"308\" \/><\/a> <\/p>\n<p>I think you can use these principals and techniques with other objects. Remember that you likely have to work with objects individually using ForEach. Sure, you could likely simplify my code but this will likely take a scripted solution so you might as well make it meaningful.<\/p>\n<p>If you come up with a similar solution for other types of objects or cmdlets I hope you\u2019ll share.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This morning I helped out a fellow scripter in the PowerShell forum at ScriptingAnswers.com. He was trying to figure out an Exchange 2007 problem. He wanted to update a property value, but keep the existing property values. This seems a like a reasonable request and one that isn\u2019t limited to Exchange. There are plenty of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21,4,8],"tags":[145,548,534,540],"class_list":["post-534","post","type-post","status-publish","format-standard","hentry","category-exchange","category-powershell","category-scripting","tag-array","tag-exchange","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Appending Property Values in PowerShell &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Appending Property Values in PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"This morning I helped out a fellow scripter in the PowerShell forum at ScriptingAnswers.com. He was trying to figure out an Exchange 2007 problem. He wanted to update a property value, but keep the existing property values. This seems a like a reasonable request and one that isn\u2019t limited to Exchange. There are plenty of...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2009-12-16T15:29:03+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/grantsendonbehalfto_thumb.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Appending Property Values in PowerShell\",\"datePublished\":\"2009-12-16T15:29:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/\"},\"wordCount\":491,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/12\\\/grantsendonbehalfto_thumb.png\",\"keywords\":[\"Array\",\"Exchange\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Exchange\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/\",\"name\":\"Appending Property Values in PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/12\\\/grantsendonbehalfto_thumb.png\",\"datePublished\":\"2009-12-16T15:29:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/12\\\/grantsendonbehalfto_thumb.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/12\\\/grantsendonbehalfto_thumb.png\",\"width\":\"484\",\"height\":\"308\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/534\\\/appending-property-values-in-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Exchange\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/exchange\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Appending Property Values in PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Appending Property Values in PowerShell &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Appending Property Values in PowerShell &#8226; The Lonely Administrator","og_description":"This morning I helped out a fellow scripter in the PowerShell forum at ScriptingAnswers.com. He was trying to figure out an Exchange 2007 problem. He wanted to update a property value, but keep the existing property values. This seems a like a reasonable request and one that isn\u2019t limited to Exchange. There are plenty of...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2009-12-16T15:29:03+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/grantsendonbehalfto_thumb.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Appending Property Values in PowerShell","datePublished":"2009-12-16T15:29:03+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/"},"wordCount":491,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/grantsendonbehalfto_thumb.png","keywords":["Array","Exchange","PowerShell","Scripting"],"articleSection":["Exchange","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/","name":"Appending Property Values in PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/grantsendonbehalfto_thumb.png","datePublished":"2009-12-16T15:29:03+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/grantsendonbehalfto_thumb.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/12\/grantsendonbehalfto_thumb.png","width":"484","height":"308"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/534\/appending-property-values-in-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Exchange","item":"https:\/\/jdhitsolutions.com\/blog\/category\/exchange\/"},{"@type":"ListItem","position":2,"name":"Appending Property Values in PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":539,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/539\/gui-vs-cli\/","url_meta":{"origin":534,"position":0},"title":"GUI vs CLI","author":"Jeffery Hicks","date":"January 4, 2010","format":false,"excerpt":"I often talk about using PowerShell GUIs vs the console experience. There is certainly a place for a GUI, but sometimes you need the raw power that comes with a console session. Here\u2019s an example. Not to long ago I saw a post in the PowerShell forum at ScriptingAnswers.com. The\u2026","rel":"","context":"In &quot;Exchange&quot;","block_context":{"text":"Exchange","link":"https:\/\/jdhitsolutions.com\/blog\/category\/exchange\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1938,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1938\/friday-fun-a-powershell-console-menu\/","url_meta":{"origin":534,"position":1},"title":"Friday Fun &#8211; A PowerShell Console Menu","author":"Jeffery Hicks","date":"December 30, 2011","format":false,"excerpt":"When working in PowerShell, and especially when scripting, you might want to give the user a choice of actions. For example, you might develop a configuration script that another admin or technician will run. Perhaps one of the steps is to configure networking depending on their location so you want\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/console-menu-300x187.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":558,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/558\/promoting-scripting-and-powershell\/","url_meta":{"origin":534,"position":2},"title":"Promoting Scripting and PowerShell","author":"Jeffery Hicks","date":"January 21, 2010","format":false,"excerpt":"Last week I was interviewed on the Mind of Root podcast about what administrators can do to promote PowerShell and automation in their environments. The show is now available for streaming or download. I still think your best approach is to gently let everyone know that it's not a matter\u2026","rel":"","context":"In &quot;Exchange&quot;","block_context":{"text":"Exchange","link":"https:\/\/jdhitsolutions.com\/blog\/category\/exchange\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":130,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/130\/techmentor-san-francisco-2008\/","url_meta":{"origin":534,"position":3},"title":"Techmentor San Francisco 2008","author":"Jeffery Hicks","date":"February 22, 2008","format":false,"excerpt":"I finished up my slide decks last week for the first Techmentor conference of the year in San Francisco (March 30 -April 3). If you've never been to a Techmentor conference you're missing a great opportunity to hear and see your favorite IT speakers. Plus it's a lot of fun\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":29,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/29\/exchangemonitorplus-2-0\/","url_meta":{"origin":534,"position":4},"title":"ExchangeMonitorPlus 2.0","author":"Jeffery Hicks","date":"April 3, 2006","format":false,"excerpt":"Version 2 of my popular ExchangeMonPlus monitoring and reporting tool for Exchange 2003 is now available. This HTA uses WMI and ADSI to monitor, manage and report on Exchange 2003 servers. The latest version provides greater detail on storage group and server utilization including quotas and mailbox reports. I've even\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9074,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9074\/the-value-of-objects\/","url_meta":{"origin":534,"position":5},"title":"The Value of Objects","author":"Jeffery Hicks","date":"July 5, 2022","format":false,"excerpt":"This is a reprint of an article published earlier this year in my premium PowerShell newsletter, Behind the PowerShell Pipeline. This is a sample of what my subscribers get 6-8 times a month. I expect I will write several articles about PowerShell and its relationship with objects. I know that\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/07\/getting-drive-usage.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/07\/getting-drive-usage.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/07\/getting-drive-usage.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}