I want to do the following using PowerShell.
Create a new PST file "Data1.PST"
Mark the file "Data1.PST" as default.
Delete the original default PST file.
Not in PS or Outlook Object Model alone - you need to use Extended MAPI (C++ or Delphi) or Redemption (any language, I am its author) or ProfMan (comes with the distributable version of Redemption).
Redemption - if you are already dealing with an active Outlook Session. Use RDOSession.Stores.DefaultStore
to open the default store. Use RDOPstStore.PstPath
to figure out the path to the PST file. To add a new PST store, use RDOSession.Stores.AddPstStore
. You can then change the RDOStore.Default
property to true.
ProfMan (if you want to manipulate the existing profiles without actually logging in) - see an example at https://www.dimastr.com/redemption/profman_examples.htm#example4. -