{"id":516119,"date":"2010-04-05T03:00:00","date_gmt":"2010-04-05T07:00:00","guid":{"rendered":"tag:blogger.com,1999:blog-1652419620964346731.post-7753620232415074958"},"modified":"2010-04-05T03:00:00","modified_gmt":"2010-04-05T07:00:00","slug":"how-to-add-a-new-domain-to-all-email-addresses-in-active-directory","status":"publish","type":"post","link":"https:\/\/mereja.media\/index\/516119","title":{"rendered":"How to add a new domain to all email addresses in Active Directory"},"content":{"rendered":"<p>So recently one of our System Administrators had been tasked with updating all of our users to a new domain that we bought. He then though, \u201cHow do I add a new domain to all email addresses in Active Directory using PowerShell?\u201d This is when he though, who better to help me do some scripting but, [queue heroic music] \u2018FreedomChicken\u2019! The ever friendly developer who with his powers of Debugging and Google Searching can single handily defeat evil Bugs and Hang-ups in applications and scripts. Now with Freedom chicken on the job the two were able to defeat this evil foe in a quick and timely manner. The result of this victory will be as follows.<\/p>\n<\/p>\n<p>PowerShell Script:<\/p>\n<p style=\"font-style: italic; color: rgb(51, 51, 255);\">get-mailbox %username% | foreach {<\/p>\n<p style=\"font-style: italic; color: rgb(51, 51, 255);\">                [string]$smtpaddress = Get-mailbox $_  | select primarysmtpaddress<\/p>\n<p style=\"font-style: italic; color: rgb(51, 51, 255);\">                $addressarray = $smtpaddress.split(&#8220;@&#8221;)<\/p>\n<p style=\"font-style: italic; color: rgb(51, 51, 255);\">                $addressarray1 = $addressarray[1].split(&#8220;=&#8221;)<\/p>\n<p style=\"font-style: italic; color: rgb(51, 51, 255);\">                [string]$newmail=$addressarray1[1]+=&#8221;@NEWDOMAIN.com&#8221;<\/p>\n<p style=\"font-style: italic; color: rgb(51, 51, 255);\">                $_.EmailAddresses+=$newmail<\/p>\n<p style=\"font-style: italic; color: rgb(51, 51, 255);\">                $_<\/p>\n<p style=\"font-style: italic; color: rgb(51, 51, 255);\">} |Set-Mailbox<\/p>\n<p><\/p>\n<div style=\"text-align: right;\">By <a href=\"http:\/\/twitter.com\/FreedomChicken\">FreedomChicken<\/a><\/div>\n<div class=\"blogger-post-footer\"><Br \/><center><a href=\"http:\/\/www.anrdoezrs.net\/click-3773910-10438541?cm_mmc=CJ-_-2769020-_-3773910-_-Home_468x60-Anim_8-24-2006\" ><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ftjcfx.com\/image-3773910-10438541\" width=\"468\" height=\"60\" alt=\"Great Deals @ Geeks.com!\" border=\"0\"\/><\/a><\/center><img width='1' height='1' src='https:\/\/blogger.googleusercontent.com\/tracker\/1652419620964346731-7753620232415074958?l=www.bauer-power.net' alt='' \/><\/div>\n<div class=\"feedflare\">\n<a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:yIl2AUoC8zA\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=yIl2AUoC8zA\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:dnMXMwOfBR0\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=dnMXMwOfBR0\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:V_sGLiPBpWU\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=CRzVIb4ko1U:IqjM0zC6oXc:V_sGLiPBpWU\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:gIN9vFwOqvQ\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=CRzVIb4ko1U:IqjM0zC6oXc:gIN9vFwOqvQ\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:YwkR-u9nhCs\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=YwkR-u9nhCs\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:F7zBnMyn0Lo\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=CRzVIb4ko1U:IqjM0zC6oXc:F7zBnMyn0Lo\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:wF9xT3WuBAs\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=CRzVIb4ko1U:IqjM0zC6oXc:wF9xT3WuBAs\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:jTJX5pvEcCQ\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=CRzVIb4ko1U:IqjM0zC6oXc:jTJX5pvEcCQ\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:TzevzKxY174\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=TzevzKxY174\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:qj6IDK7rITs\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=qj6IDK7rITs\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:7Q72WNTAKBA\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=7Q72WNTAKBA\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:nHK9nIK91uw\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=CRzVIb4ko1U:IqjM0zC6oXc:nHK9nIK91uw\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=CRzVIb4ko1U:IqjM0zC6oXc:tdI4wLSbWXI\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=CRzVIb4ko1U:IqjM0zC6oXc:tdI4wLSbWXI\" border=\"0\"><\/img><\/a>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~r\/Bauer-power\/~4\/CRzVIb4ko1U\" height=\"1\" width=\"1\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So recently one of our System Administrators had been tasked with updating all of our users to a new domain that we bought. He then though, \u201cHow do I add a new domain to all email addresses in Active Directory using PowerShell?\u201d This is when he though, who better to help me do some scripting [&hellip;]<\/p>\n","protected":false},"author":3078,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-516119","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/516119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/users\/3078"}],"replies":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/comments?post=516119"}],"version-history":[{"count":0,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/516119\/revisions"}],"wp:attachment":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/media?parent=516119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/categories?post=516119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/tags?post=516119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}