{"id":86549,"date":"2019-10-23T13:00:42","date_gmt":"2019-10-23T21:00:42","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/scripting\/?p=86549"},"modified":"2019-10-18T07:41:36","modified_gmt":"2019-10-18T15:41:36","slug":"powertip-using-set-aduser-with-multi-valued-attributes","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-using-set-aduser-with-multi-valued-attributes\/","title":{"rendered":"PowerTip: Using Set-ADUser with multi-valued attributes"},"content":{"rendered":"<p><strong>Summary<\/strong>: Using the -Replace parameter with Set-ADUser to take an array to populate multi-valued attributes<\/p>\n<p><img decoding=\"async\" width=\"34\" height=\"34\" class=\"wp-image-86550\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/10\/a-picture-containing-scissors-description-automat-5.jpeg\" alt=\"A picture containing scissors\n\nDescription automatically generated\" \/><\/p>\n<p>Question: Hey Doctor Scripto, how can I use Set-ADUser to populate multivalued attributes in Active Directory?<\/p>\n<p><img decoding=\"async\" width=\"34\" height=\"34\" class=\"wp-image-86551\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/10\/word-image-5.jpeg\" \/><\/p>\n<p>Answer: You can use an array with the -Replace parameter to do it.<\/p>\n<p><strong>Set-ADUser -Identity &#8220;TestUser&#8221; -Replace @{ProxyAddresses = @(&#8220;Address1&#8243;,&#8221;Address2&#8243;,&#8221;Address3&#8221;)}<\/strong><\/p>\n<p><img decoding=\"async\" width=\"96\" height=\"145\" class=\"wp-image-86552\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/10\/word-image-13.png\" \/><\/p>\n<p>PowerShell, Doctor Scripto, PowerTip, Active Directory, Walid Moselhy<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Using the -Replace parameter with Set-ADUser to take an array to populate multi-valued attributes Question: Hey Doctor Scripto, how can I use Set-ADUser to populate multivalued attributes in Active Directory? Answer: You can use an array with the -Replace parameter to do it. Set-ADUser -Identity &#8220;TestUser&#8221; -Replace @{ProxyAddresses = @(&#8220;Address1&#8243;,&#8221;Address2&#8243;,&#8221;Address3&#8221;)} PowerShell, Doctor Scripto, PowerTip, [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2641,1739,1738,639],"tags":[7,1740,377,356,2642],"class_list":["post-86549","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-active-directory","category-doctor-scripto","category-powershell","category-powertip","tag-active-directory","tag-doctor-scripto","tag-powershell","tag-powertip","tag-walid-moselhy"],"acf":[],"blog_post_summary":"<p>Summary: Using the -Replace parameter with Set-ADUser to take an array to populate multi-valued attributes Question: Hey Doctor Scripto, how can I use Set-ADUser to populate multivalued attributes in Active Directory? Answer: You can use an array with the -Replace parameter to do it. Set-ADUser -Identity &#8220;TestUser&#8221; -Replace @{ProxyAddresses = @(&#8220;Address1&#8243;,&#8221;Address2&#8243;,&#8221;Address3&#8221;)} PowerShell, Doctor Scripto, PowerTip, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/86549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=86549"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/86549\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=86549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=86549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=86549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}