In exchange daily administration, administrators often configure the user mailbox properties e-mail address, as one of my customers, when deploying Exchange, requires the configuration of three suffix domain names. However, just after 3 months, the customer asked to delete one, but even if the address in the address policy is deleted, the user's address will not be deleted. The general method is to use the ADModify tool, but I make an error when I use it. Forget it, I'll use the command line.
If you are deleting a user's e-mail address, you can use the command: Set-mailbox "mailbox name"-emailaddresses @{remove= "Mailbox name @conto.com"} as shown in:
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "border=" 0 "alt=" image "src=" http:// S3.51cto.com/wyfs02/m02/56/cd/wkiol1sohu_rkkthaaivahsizoq679.jpg "height=" 314 "/>
However, we currently have more than 1000 users, it is definitely necessary to implement bulk deletion, the implementation method is as follows:
1. To export existing user information in Exchange, the command we use is: Get-aduser, implemented as follows:
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "border=" 0 "alt=" image "src=" http:// S3.51cto.com/wyfs02/m02/56/cf/wkiom1sohlkjbvrfaac-hgqb4ss295.jpg "height=" 276 "/>
Then run: Get-aduser-filter *-searchbase "Ou=ou name, dc= domain, dc= domain name" | Select-object Name,surname,givenname | Export-csv-path C:\users.csv, as shown in:
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "border=" 0 "alt=" image "src=" http:// S3.51cto.com/wyfs02/m00/56/cf/wkiom1sohlodxossaadbe8wgwgg677.jpg "height="/>
However, if it contains Chinese, it may appear garbled, then you can use a command similar to the following:
Get-aduser-filter *-searchbase "dc=uec,dc=com" | Select-object Name,surname,givenname | Export-csv-encoding Utf8-path C:\users.csv
2. Edit the Excel table:
This is the basic skills of Excel, not much to say, eventually formed the following format:
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "border=" 0 "alt=" image "src=" http:// S3.51cto.com/wyfs02/m02/56/cd/wkiol1sohvzbrmq9aato6zpxtag051.jpg "height=" 453 "/>
3. Execute the command: Copy the resulting command to the Exchange server and execute as shown in:
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "border=" 0 "alt=" image "src=" http:// S3.51cto.com/wyfs02/m02/56/cf/wkiom1sohmsxnvykaaug8svpkfg637.jpg "height=" 411 "/>
Okay, here we go. Let's take a look at the user's mailbox properties:
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "border=" 0 "alt=" image "src=" http:// S3.51cto.com/wyfs02/m00/56/cf/wkiom1sohmwcdxslaaf97o6nl4q073.jpg "height=" 474 "/>
All right, play it!
This article is from the "Duffy" blog, make sure to keep this source http://dufei.blog.51cto.com/382644/1590097
Remove extra e-mail addresses from Exchange user mailboxes