Solved

how to change PST location in outlook profile automatically

Posted on 2014-09-16
8
49 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 20

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 20

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
Office 365 Training for Admins

Learn how to provision tenants, synchronize on-premise Active Directory, and implement Single Sign-On with these master level course.  Only from Platform Scholar

 

Author Comment

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

Accepted Solution

by:
Qlemo earned 500 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In-place Upgrading Dirsync to Azure AD Connect
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

739 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