Solved

Looking for a script

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
exchange, scripts 30 75
Exchange 2013 Global Address List How to add customer attributes 1 31
exchange 2013 4 40
"updating address book" outlook 2016 with exchange 2016 7 40
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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.
In this video we show how to create a User 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 >> Mailb…
how to add IIS SMTP to handle application/Scanner relays into office 365.

932 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now