We help IT Professionals succeed at work.
Get Started

Powershell script to perform exchange admin tasks

Last Modified: 2015-06-27
Hi Experts,

I am kind of rush with the export of bulk mailboxes to a PST files and the EAC really sucks to perform bulk email searches and then export the results to multiple PST

Need you help to build a PowerShell script that basically will read from an input CSV file that contains exchange display name, database, and email address

So, for any member on the CSV file

Perform following tasks

' comment, the cmdlet below performs a new search against all sourcemailboxes specified there, but we should use display names for each user within the csv file

New-MailboxSearch -Name "Legal" -SourceMailboxes user1,user2 -TargetMailbox "LegalDiscovery" -StartDate "03/01/2013" -EndDate "07/02/2013" -SearchQuery 'Item1 OR item2'

' perform a search of the entire mailbox to a PST and no search criteria defined
New-MailboxExportRequest -Mailbox User1 -IncludeFolders "#Inbox#" -FilePath \\SERVER01\PSTFileShare\User1\User1.pst

'Once it finished the first search and export for the first user, will perform the remove-mailboxexportrequest to release resources. validate the pst has been created on the shared folder

Get-MailboxExportRequest | Remove-MailboxExportRequest

then repeat the entire process for each user in the CSV file

Can someone please help me with this request?
Watch Question
Enterprise Architecture Lead
Most Valuable Expert 2015
Top Expert 2015
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE