[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Exchange 2007 - Management power shell

Posted on 2014-01-30
2
Medium Priority
?
304 Views
Last Modified: 2014-01-30
Can you tell me what is the cmdlet for this result? See file Picture1

For each maibox display nam contains (DGATI), I want to replace by (DGARI)

What is the cmdlet for execute this?
Picture1.jpg
0
Comment
Question by:dgswin
2 Comments
 
LVL 9

Expert Comment

by:Mahesh Sharma
ID: 39820608
Give a try to this:

1. Export all mailbox with matching condition to csv file.

Get-Mailbox -resultsize unlimited | where-object {$_.CustomAttribute1 -eq "<Value>" -and $_.DisplayName -Match 'DGATI' } | Select Alias, DisplayName | Export-Csv c:\output.csv

2. Not open CSV & replace all DGATI with DGARI
If csv contains " with all reocrds, replace them with null value. Remove first row as well.

3. Import the csv back to mailboxes.

$Temp = Import-Csv c:\output.csv
Foreach ($tmp in $temp) {Get-Mailbox $tmp.Alias | Set-Mailbox -DisplayName $tmp.DisplayName}

Always Try in lab first
0
 
LVL 71

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 39820732
Besides point 2 is probably a typo, that procedure is overcomplicated. PowerShell can do this in one go.
Get-Mailbox -resultsize unlimited |
  where-object {$_.CustomAttribute1 -eq 'D. G. resources humaines et resources informationelles' -and $_.DisplayName -like '*DGATI*' }  |
  % {
    Set-Mailbox $_ -DisplayName $_.Displayname.Replace('DGATI', 'DGARI')
 }

Open in new window

You can add the -whatif to Set-Mailbox to simulate the change only.
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses
Course of the Month17 days, 18 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question