PowerShell removes extra e-mail addresses from Exchange user mailboxes

Source: Internet
Author: User
Tags domain list

today is nothing to do, see Duffy teacher on the 51cto blog an article on writing Exchange delete user mailbox in the redundant email address of the blog address, blog link: http://dufei.blog.51cto.com/382644/1590097 , continue to read the same article on the Internet, and find an article Srinivasan Xu Dashi on the CSDN blog, is the same theme, blog links: http://blog.csdn.net/fogyisland2000/article/details/7805291

, Master Xu said this program I found the official link, has stopped updating, the latest version is released in 2009.

http://admodify.codeplex.com/releases/view/6065

650) this.width=650; "title=" clip_image002 "style=" border-top:0px;height:512px;border-right:0px;border-bottom:0px ; border-left:0px;width:715px; "border=" 0 "alt=" clip_image002 "src=" http://s3.51cto.com/wyfs02/M02/58/76/ Wkiol1syl9njfkjaaah-me6ulr4533.jpg "width=" 888 "height=" 604 "/>

continue to find similar articles, found on the Internet or in a Windows Server 2012 environment using the ADModify case, see the following link, http://www.dotblogs.com.tw/swater111/archive/2013/06/25/106062.aspx ,

650) this.width=650; "title=" clip_image004 "style=" border-top:0px;height:379px;border-right:0px;border-bottom:0px ; border-left:0px;width:714px; "border=" 0 "alt=" clip_image004 "src=" http://s3.51cto.com/wyfs02/M00/58/76/ Wkiol1syl9uifvzzaaixtxppmxc888.jpg "width=" 890 "height=" 425 "/>

Here's how to start a demonstration of the next three ways to modify your email address.

First, use Powershell+excel to modify mailbox properties

Step 1, if you delete a user's e-mail address, you can use the command: set-mailbox–identity "mailbox name"-emailaddresses @{remove= "Mailbox name @51service.com.cn"}, as shown in:

650) this.width=650; "title=" clip_image006 "style=" border-top:0px;height:366px;border-right:0px;border-bottom:0px ; border-left:0px;width:718px; "border=" 0 "alt=" clip_image006 "src=" http://s3.51cto.com/wyfs02/M01/58/76/ Wkiol1syl92ignd0aaesrfazjas263.jpg "width=" 893 "height=" "/>"

Step 2, the settings take effect, the extra email address has been removed from the email address.

650) this.width=650; "title=" clip_image008 "style=" border-top:0px;height:512px;border-right:0px;border-bottom:0px ; border-left:0px;width:718px; "border=" 0 "alt=" clip_image008 "src=" http://s3.51cto.com/wyfs02/M02/58/76/ Wkiol1syl96gpob6aadply5p2em602.jpg "width=" 893 "height=" 538 "/>

Step 3, e-mail address is not too much work can be accepted, mailbox more words, it is not technical life but physical life, time-consuming laborious also prone to error. Below I explain the method of bulk deletion.

Since our email address policy is [email protected], we export the alias property in bulk.

650) this.width=650; "title=" clip_image010 "style=" border-top:0px;height:672px;border-right:0px;border-bottom:0px ; border-left:0px;width:603px; "border=" 0 "alt=" clip_image010 "src=" http://s3.51cto.com/wyfs02/M00/58/76/ Wkiol1syl-gjwloyaaks986i5b0862.jpg "width=" 899 "height=" 903 "/>

The command line is as follows:

[PS] C:\windows\system32>get-mailbox-resultsize Unlimited | Select-object Name,alias | Export-csv c:\uesrinfo.csv-Encoding utf8-notypeinformation

650) this.width=650; "title=" clip_image012 "style=" border-top:0px;height:426px;border-right:0px;border-bottom:0px ; border-left:0px;width:724px; "border=" 0 "alt=" clip_image012 "src=" http://s3.51cto.com/wyfs02/M01/58/76/ Wkiol1syl-pxjbz4aaek64hwzru066.jpg "width=" 903 "height=" 502 "/>

Step 4, use the Excel function a&b&c to organize and pull to the end of the line, the final effect such as

650) this.width=650; "title=" clip_image014 "style=" border-top:0px;height:620px;border-right:0px;border-bottom:0px ; border-left:0px;width:728px; "border=" 0 "alt=" clip_image014 "src=" http://s3.51cto.com/wyfs02/M02/58/76/ Wkiol1syl-jwkrukaatv9xoc5aa298.jpg "width=" 902 "height=" 734 "/>

Step 5, do not avoid the subsequent import in Chinese garbled, the edited Uesrinfo. csv is saved as UTF8 encoding.

650) this.width=650; "title=" clip_image016 "style=" border-top:0px;height:422px;border-right:0px;border-bottom:0px ; border-left:0px;width:728px; "border=" 0 "alt=" clip_image016 "src=" http://s3.51cto.com/wyfs02/M00/58/76/ Wkiol1syl-vrt_qzaai4fctvqpc305.jpg "width=" 906 "height=" 511 "/>

Step 6, Save the modified uesrinfo. csv file to the Exchange Server C drive and execute the Modify command. [Hint "Zhou ping" is not modified is preceded by a single-line command has been modified]

[PS] C:\windows\system32>import-csv-path C:\uesrinfo.csv | foreach {set-mailbox-identity $_.name-emailaddresses @{remove=$_.alias}}

650) this.width=650; "title=" clip_image018 "style=" border-top:0px;height:426px;border-right:0px;border-bottom:0px ; border-left:0px;width:730px; "border=" 0 "alt=" clip_image018 "src=" http://s3.51cto.com/wyfs02/M01/58/76/ Wkiol1syl-7zdwgcaajd9i31hxy937.jpg "width=" 910 "height=" 506 "/>

Step 7, we check the account, found that the email address has been modified, the extra email address has been deleted.

650) this.width=650; "title=" clip_image020 "style=" border-top:0px;height:551px;border-right:0px;border-bottom:0px ; border-left:0px;width:729px; "border=" 0 "alt=" clip_image020 "src=" http://s3.51cto.com/wyfs02/M01/58/79/ Wkiom1sylymsx927aaem0_gz4ma867.jpg "width=" 912 "height=" 587 "/>

Second, use PowerShell to modify mailbox properties [do not use Excel]

Step 1, delete the email address policy that is not required.

650) this.width=650; "title=" clip_image022 "style=" border-top:0px;height:474px;border-right:0px;border-bottom:0px ; border-left:0px;width:727px; "border=" 0 "alt=" clip_image022 "src=" http://s3.51cto.com/wyfs02/M01/58/79/ Wkiom1sylyrzzzmoaaehnygyhyg106.jpg "width=" 911 "height=" 556 "/>

Step 2, enter the following command to remove the unwanted email address.

[PS] C:\windows\system32>get-mailbox-resultsize Unlimited | Select-object Name,alias| foreach {set-mailbox-identity $_.name-emailaddresses @{remove= ($_.alias+ "@ 51service.com.cn ")}}

650) this.width=650; "title=" 1.png "style=" HEIGHT:445PX;WIDTH:724PX; "alt=" Wkiom1synrnjauk_aafczhviapu961.jpg "src= "Http://s3.51cto.com/wyfs02/M01/58/7D/wKiom1Synrnjauk_AAFCzhviaPU961.jpg" width= "996" height= "488"/>

Step 3, we check the account attributes, found that the discarded email address has been deleted.

650) this.width=650; "title=" clip_image036 "style=" border-top:0px;height:512px;border-right:0px;border-bottom:0px ; border-left:0px;width:721px; "border=" 0 "alt=" clip_image036 "src=" http://s3.51cto.com/wyfs02/M02/58/76/ Wkiol1symbpgn9lcaaevq5wmfi0338.jpg "width=" 894 "height=" 606 "/>

third, use Admodify.net to modify mailbox properties

Admodify.net program see the blog at the end of the attachment download

Step 1, delete the email address policy that is not required.

650) this.width=650; "title=" clip_image022 "style=" border-top:0px;height:474px;border-right:0px;border-bottom:0px ; border-left:0px;width:727px; "border=" 0 "alt=" clip_image022 "src=" http://s3.51cto.com/wyfs02/M01/58/79/ Wkiom1sylyrzzzmoaaehnygyhyg106.jpg "width=" 911 "height=" 556 "/>

Step 2, after the deletion of the address policy, found that the address of the deletion policy corresponding to the mailbox address is still there, if one to delete, labor time laborious, still may not be wrong, below we use ADModify Bulk Modify AD account attributes to achieve the effect we want.

Run admodify and select Modify Attributes.

650) this.width=650; "title=" clip_image024 "style=" border-top:0px;height:540px;border-right:0px;border-bottom:0px ; border-left:0px;width:725px; "border=" 0 "alt=" clip_image024 "src=" Http://s3.51cto.com/wyfs02/M00/58/76/wKioL1SyL _wafkhxaaqhvninn2y682.jpg "width=" 914 "height=" 641 "/>

Step 3, select Domain List,domain controller list, execute the green arrow, and finally select Add to List

650) this.width=650; "title=" clip_image026 "style=" border-top:0px;height:567px;border-right:0px;border-bottom:0px ; border-left:0px;width:725px; "border=" 0 "alt=" clip_image026 "src=" Http://s3.51cto.com/wyfs02/M01/58/76/wKioL1SyL _rj5or8aaqx9xmlqt4321.jpg "width=" 911 "height=" 673 "/>

Step 4, choose Select All, select Next

650) this.width=650; "title=" clip_image028 "style=" border-top:0px;height:582px;border-right:0px;border-bottom:0px ; border-left:0px;width:726px; "border=" 0 "alt=" clip_image028 "src=" Http://s3.51cto.com/wyfs02/M02/58/76/wKioL1SyL __bpjn1aaq5enueihg591.jpg "width=" 911 "height=" 677 "/>

Step 5, select the E-mail address option

650) this.width=650; "title=" clip_image030 "style=" border-top:0px;height:722px;border-right:0px;border-bottom:0px ; border-left:0px;width:595px; "border=" 0 "alt=" clip_image030 "src=" http://s3.51cto.com/wyfs02/M02/58/79/ Wkiom1sylz6bqc9zaawdl-gtzxy508.jpg "width=" 904 "height=" 1037 "/>

Step 6, continue to select Remove e-mail Address, fill in the domain name to be removed smtp:*@ @51service.com.cn, in the selection go! Oh, this is so funny.

650) this.width=650; "title=" clip_image032 "style=" border-top:0px;height:712px;border-right:0px;border-bottom:0px ; border-left:0px;width:598px; "border=" 0 "alt=" clip_image032 "src=" http://s3.51cto.com/wyfs02/M00/58/7A/ Wkiom1syl0xdrd5jaawwjiiimie540.jpg "width=" 901 "height=" 1029 "/>

Step 7, prompt operation succeeded.

650) this.width=650; "title=" clip_image034 "style=" border-top:0px;height:709px;border-right:0px;border-bottom:0px ; border-left:0px;width:599px; "border=" 0 "alt=" clip_image034 "src=" http://s3.51cto.com/wyfs02/M02/58/7A/ Wkiom1syl0utpgiiaavxivokwwy132.jpg "width=" 896 "height=" 1027 "/>

Step 8, we check the account attributes, found that the discarded email address has been deleted.

650) this.width=650; "title=" clip_image036 "style=" border-top:0px;height:512px;border-right:0px;border-bottom:0px ; border-left:0px;width:721px; "border=" 0 "alt=" clip_image036 "src=" http://s3.51cto.com/wyfs02/M02/58/76/ Wkiol1symbpgn9lcaaevq5wmfi0338.jpg "width=" 894 "height=" 606 "/>

This article is from the "Zhou Ping Microsoft Technology Exchange Platform" blog, please be sure to keep this source http://yuntcloud.blog.51cto.com/1173839/1601895

PowerShell removes extra e-mail addresses from Exchange user mailboxes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.