Solved

Looking for a script

Posted on 2013-12-23
5
307 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
[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
  • 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 500 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
In this video we show how to create a Contact 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 Recipients >> Contact ta…
In this video we show how to create an Accepted Domain 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 >> Ac…

752 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