Solved

Looking for a script

Posted on 2013-12-23
5
304 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 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
In this video we show how to create a Shared Mailbox 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 >> Sha…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

777 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