Solved

Exchange 2007 - Management power shell

Posted on 2014-01-30
2
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 70

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
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.
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…

691 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