• RSS
  • Twitter
  • FaceBook

Exchange Server Forums

Forums | Register | Login | My Profile | Inbox | RSS RSS icon | My Subscription | My Forums | Address Book | Member List | Search | FAQ | Ticket List | Log Out

PowerShell PST Location

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [Microsoft Exchange 2007] >> General >> PowerShell PST Location Page: [1]
Login
Message << Older Topic   Newer Topic >>
PowerShell PST Location - 28.Sep.2009 5:40:41 PM   
ostar

 

Posts: 3
Joined: 6.Mar.2009
Status: offline
Is it possible to change the PST file location for an Outlook 2003/2007 client using Powershell ?
Post #: 1
RE: PowerShell PST Location - 28.Sep.2009 5:54:31 PM   
mark@mvps.org

 

Posts: 6812
Joined: 9.Jun.2004
From: Philadelphia PA
Status: offline
Within the Outlook client? No. That's purely Outlook and has nothing to do with Exchange. Why would you think otherwise? Have you read something misleading like that?

If you mean whether you can specify the path to a PST file when you're doing the export-mailbox command then sure. See: http://technet.microsoft.com/en-us/library/aa998579.aspx for the syntax to specify the path.

_____________________________

Mark Arnold (Exchange MVP)
List Moderator

(in reply to ostar)
Post #: 2
RE: PowerShell PST Location - 28.Sep.2009 6:16:31 PM   
ostar

 

Posts: 3
Joined: 6.Mar.2009
Status: offline
quote:

ORIGINAL: mark@mvps.org

Within the Outlook client? No. That's purely Outlook and has nothing to do with Exchange. Why would you think otherwise? Have you read something misleading like that?


I'm trying to manipulate with powershell the PST file path as seen by Outlook.

I give an example:
PS > $ol = new-object -com outlook.application
PS > $ns = $ol.getNamespace("MAPI")
PS > $ns.stores

Result:
...
FilePath               : C:\PST_File.pst
...


and here ends my powershell PST knowledge..
i appreciate any ideeas about modifying the PST FilePath for pointing to a new location.

thanks much

(in reply to mark@mvps.org)
Post #: 3
RE: PowerShell PST Location - 29.Sep.2009 8:14:12 AM   
ShayL

 

Posts: 6
Joined: 18.May2008
Status: offline
You cannot manipulate the path, the path is updated based on the PST location on disk. I guess you want to move it to another location, if so:

$ol = new-object -com outlook.application
$ns = $ol.getNamespace("MAPI")

$Destination = "\\server\share"

$ns.stores | where {$_.ExchangeStoreType -eq 3} | select StoreID,DisplayName,FilePath | foreach {
$pst = $ns.GetFolderFromID($_.StoreID)
$pstName = [io.path]::GetFileName($_.FilePath)
$ns.RemoveStore($pst)
Copy-Item -Path $_.FilePath -Destination $Destination | out-null
$ns.AddStore("$Destination\$pstName")
}

_____________________________

Shay Levy
Windows PowerShell MVP
http://PowerShay.com
PowerShell Toolbar: http://tinyurl.com/PSToolbar
Twitter: http://twitter.com/ShayLevy

(in reply to ostar)
Post #: 4

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [Microsoft Exchange 2007] >> General >> PowerShell PST Location Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Follow TechGenix on Twitter