Solved

Exchange 2007 - Management power shell

Posted on 2014-01-30
2
294 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 69

Accepted Solution

by:
Qlemo earned 500 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This article explains how to install and use the NTBackup utility that comes with Windows Server.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
This video discusses moving either the default database or any database to a new volume.

733 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