Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Looking for a script

Posted on 2013-12-23
5
Medium Priority
?
310 Views
Last Modified: 2014-01-14
I am looking for a script to archive the .pst files for the  all the users on a particular OU.
Thanks
0
Comment
Question by:jmohan0302
  • 3
  • 2
5 Comments
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 39736188
Are you wanting to Export user mailboxes to PST for a particular OU?

Please provide more detail.

Will.
0
 

Author Comment

by:jmohan0302
ID: 39736478
Yes.  The users who left the organization will be disabled. These disabled users will be moved to a OU called disabled. So the .PST of the users in the disabled OU has to be archived on a centralized location. I want to write a script for archiving the .pst files of the users on the ou called Disabled. Thanks
0
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 2000 total points
ID: 39736564
What verison of Exchange are you using?

You can use something like the script below to accomplish this...

$Users = get-mailbox -OrganizationalUnit <ou here>
foreach ($User in $Users) {Export-Mailbox -Identity $User -PSTFolderPath "c:\pstfiles" -BadItemLimit 1000000 -confirm:$false}

Open in new window


Will.
0
 

Author Comment

by:jmohan0302
ID: 39736803
Hi Will Thanks a lot
What is the extension to be saved, is it .ps? or.bat file

Also please let me know do I need to provide just the OU name or the distinguished name of the OU.....Thanks
0
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 39736857
You can copy and past this in to a text file and save the file extension to .PS1. You will need to run this script in the Exchange Management shell (.\scriptname.ps1)

Also for the OU you need to use the following syntax below...

OU=disabled,DC=domain,DC=com

If your OU that is called disabled is not at the top level you need to use the same syntax and add the additional OU structure.

The below example illustrates having Users are the toplevel OU and disabled OU underneith.
OU=disabled,OU=testou,DC=domain,DC=com


Will.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Want to know how to use Exchange Server Eseutil command? Go through this article as it gives you the know-how.
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

972 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