Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Determine PST Format

Reply
 
Old 04-21-2009   #1 (permalink)
jtsm


 
 

Determine PST Format

Hi there,

Is anyone able to tell me if it's possible to use powershell to determine
the version\format of a PST file?

Thanks,

jtsm

My System SpecsSystem Spec
Old 04-21-2009   #2 (permalink)
jtsm


 
 

RE: Determine PST Format

Another option might be to use powershell, to determine if the encoding is
unicode or ansi...
My System SpecsSystem Spec
Old 04-22-2009   #3 (permalink)
Robert Robelo


 
 

Re: Determine PST Format

It may not be the safest/best way, but I tell them apart by checking the char length of the StoreID:

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# ScriptBlock that retrieves the PST Format
$sb = {$(switch ($this.StoreID.length) {
{$_ -le 140} {'Personal Folders File (97-2002)'; break}
default {'Personal Folders File'; break}
})}
# Outlook instance
$ol = new-object -c outlook.application
$ol.session.stores | # ...or $ol.getNamespace('Mapi').stores |
add-member ScriptProperty Format -value $sb -passthru |
ft FilePath, DisplayName, Format -autoSize -wrap
$ol.quit()
# next line may not be necessary in your system
while (ps -n outlook -ea 0) {spps -n outlook}

--
Robert
My System SpecsSystem Spec
Old 04-22-2009   #4 (permalink)
jtsm


 
 

Re: Determine PST Format

Thanks Robert,

Is there a way to have it check a detached from Outlook PST file?

for example, if I had alot of PST files on a file share, and have it check
each one for the format?

I'm pretty novice with PS, and when you start using constants, I loose track
somewhat with what the script is doing... esp the instance section..

Thanks,

jtsm

"Robert Robelo" wrote:
Quote:

> It may not be the safest/best way, but I tell them apart by checking the
> char length of the StoreID:
>
> # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
> # ScriptBlock that retrieves the PST Format
> $sb = {$(switch ($this.StoreID.length) {
> {$_ -le 140} {'Personal Folders File (97-2002)'; break}
> default {'Personal Folders File'; break}
> })}
> # Outlook instance
> $ol = new-object -c outlook.application
> $ol.session.stores | # ...or $ol.getNamespace('Mapi').stores |
> add-member ScriptProperty Format -value $sb -passthru |
> ft FilePath, DisplayName, Format -autoSize -wrap
> $ol.quit()
> # next line may not be necessary in your system
> while (ps -n outlook -ea 0) {spps -n outlook}
>
> --
> Robert
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
-f format Format-Table Format-List against Select PowerShell
Windows Mail format bar doesn't format color, size, justification Browsers & Mail
Rich text format or HTML format Vista performance & maintenance
Converting date time format to string format PowerShell
Help! DVD format error: "Windows was unable to complete the format Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46