Solved

Looking for a script

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Resolve DNS query failed errors for Exchange
In this video we show how to create a mailbox database 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 Servers >> Data…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

759 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

19 Experts available now in Live!

Get 1:1 Help Now