?
Solved

how to change PST location in outlook profile automatically

Posted on 2014-09-16
8
Medium Priority
?
62 Views
Last Modified: 2016-01-03
Hi Experts,

now we have some clients with outlook and they use PST files connected to a share.
This share will be changed now.
But I wont to do this for each user and outlook profile.
Is it possible to do it with script or automatically ?
0
Comment
Question by:Eprs_Admin
[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
8 Comments
 
LVL 21

Expert Comment

by:netcmh
ID: 40325619
0
 

Author Comment

by:Eprs_Admin
ID: 40341091
This script is very complicated.
Do you have something easier ?
0
 
LVL 21

Expert Comment

by:netcmh
ID: 40341594
That code is in C++. You just need to compile it and run it as:
UpdatePSTPath c:\old\path c:\new\path
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Eprs_Admin
ID: 40376501
ok I will check it...
0
 
LVL 70

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 40402158
Here is a PowerShell script I wrote (based on VBS code found at  http://community.spiceworks.com/scripts/show/2320-update-pst-path-registry).
You need to run that e.g. as login script, as it runs only for the current user.
The locations used should be obvious ;-).
Currently the script is in test mode - no moving of PST files, and the reg key changed is a copy only. See notes in the code for changes to do the real stuff.
cls
# *** change this to your destination root
$oldLocation = "\\oldserver\pstshare\$env:UserName\"
$newLocation = "\\newserver\pstshare\$env:UserName\"
dir -Recurse 'HKCU:Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook' |
  ? { $_.Property -contains "001f6700" } |
  % {
    get-itemproperty $_.PsPath "001f6700"
  } |
  % {
    $bytes = $_."001f6700"
    $curpath = (-join [Char[]] $(foreach ($i in 1..($bytes.Count-1)) { if ($i % 2) { $bytes[$i]*256 + $bytes[$i-1] } })).Trim(0)
    if ($curpath -like "$oldLocation*") {
      Write-Host "Old server path found in $($_.PsPath.Replace($_.PsProvider.ToString()+'::','')): $curpath"
      Move-Item $curpath $newLocation -whatif   # *** Remove -whatif if certain
      if ($?) {
        $newpath = Join-Path $newLocation (split-path -Leaf $curpath)
        # *** replace "001f6700 test" with "001f6700" if certain
        Set-ItemProperty $_.PsPath "001f6700 test" -value ([Byte[]]($(foreach ($i in ([byte[]] [Char[]] $newpath)) { $i, 0 })+@(0,0)))
      }
    }
  }

Open in new window

0
 

Author Comment

by:Eprs_Admin
ID: 40412816
ok I will check it...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
how to add IIS SMTP to handle application/Scanner relays into office 365.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

764 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