Link to home
Create AccountLog in
Avatar of LaurentLyon
LaurentLyon

asked on

[Exchange 2010] delete string in all mailboxe's name

Hello

I'd like to list all my mailboxes in Exchange 2010 , and when i meet a string in the mailboxe's name , i d like to delete it

Exemple : mailbox  duponttotoherve
Replace by dupontherve

Thanks
Avatar of Amit
Amit
Flag of India image

Question is not clear. Explain more.
Avatar of LaurentLyon
LaurentLyon

ASKER

id like to replace all string "xxxxxx" in display name of all mailboxes

Exemple : hervexxxxxxdupont
Id like to replaceit  with it hervedupont
( delete xxxxxxx for each mailbox IF EXIST)

Not all the mailboxes have this string , only 60%

Is it clear ?

Thanks
It seems you are referring to Email address policy in Exchange 2010. Check what email address policy is applied and modify it accordingly.
I d like a powershell script who rename all mailboxe with deleting the string in the name
Lauren let me ask you is there some Attribute that matched the same you want for those users ?

Amit: What lauren is saying let me explain in detail (Just an example)

Alias
Amit&%Kulshrestha
Manpreet#Singh
LaurenLyon

So he wants your and my ID to be corrected and Symbols\etc to be removed

- Rancy
Yes , It s the same string on all the mailboxes
Thanks Rancy. A screenshot will give more details. Lauren , can post the screenshot.
Example :
Mailboxe 1 : alias herveSTRINGdupont
Mailboxe 2 : alias jeanSTRINGdupond
Mailboxe 3 : alias johnSTRINGlenon

 = => replace with

Mailboxe 1 : alias hervedupont
Mailboxe 2 : alias jeandupond
Mailboxe 3 : alias johnlenon

( delete "STRING" on all mailboxes which contains it )
In this situation you can use admodify tool
http://technet.microsoft.com/en-us/library/aa996216%28v=exchg.65%29.aspx

Read it properly, before making bulk changes, take the backup.
Amit dont mind but as u had asked earlier Admodify will work if we have another similar attribute that can replace the affected one

So Lauren do we have another Attribute that can replace the affected one

- Rancy
it s the same attribute to replace in all mailboxes
Admodify can do that for you.
I guess you didnt get me as what Amit said for the toll will work if i give it some Input to take :)

- Rancy
Try this.. I have added -WhatIf for testing, remove it to replace the string from mailbox alias..

Run the script from Exchange Management Shell..
$ST = "xxxxxx"
Get-Mailbox -ResultSize Unlimited | %{
If ($_.Alias -match $ST){
$NewAlias = $_.Alias -replace $ST
Set-Mailbox $_.Alias -Alias $NewAlias -WhatIf
 }
}

Open in new window

Hello
Thanks Subsun
I d like to rename the DISPLAYNAME and  the NAME wich contains "XXXXX" in Active Directory Users

Thanks
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account