Import .PST files into Outlook and then into amber
1. Import .pst into Outlook (Classic) Windows App

2. Make sure that the .pst appears in your mailbox overview

3. Execute the following script
This script will only export the Folder “Posteingang” and all its subfolders/items. If you have other top folders then please change line 30
$posteingang = $rootFolder.Folders.Item("Posteingang".
Also change line 2 to your personal one.
$savePath = "C:\Users\XXXXX\Downloads\test"
# --- Configuration ---
$savePath = "C:\Users\XXX\Downloads\test"
# Create target folder if it doesn't exist
if (-not (Test-Path $savePath)) {
New-Item -ItemType Directory -Path $savePath -Force | Out-Null
}
# --- Connect to Outlook ---
$outlook = New-Object -ComObject Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
# --- Find the PST store "Outlook-Datendatei" ---
$store = $null
foreach ($s in $namespace.Stores) {
if ($s.DisplayName -eq "Outlook-Datendatei") {
$store = $s
break
}
}
if (-not $store) {
Write-Error "PST store 'Outlook-Datendatei' not found."
exit 1
}
# --- Navigate to Posteingang ---
try {
$rootFolder = $store.GetRootFolder()
$posteingang = $rootFolder.Folders.Item("Posteingang")
} catch {
Write-Error "Folder 'Posteingang' not found in the PST."
exit 1
}
# --- Recursive export function ---
function Export-MailFolder {
param(
[Parameter(Mandatory)] $OutlookFolder,
[Parameter(Mandatory)] [string] $TargetPath
)
$olMSG = 3
# Create the matching subfolder on disk
if (-not (Test-Path $TargetPath)) {
New-Item -ItemType Directory -Path $TargetPath -Force | Out-Null
}
# Export all mail items in this folder
foreach ($item in $OutlookFolder.Items) {
if ($item.Class -eq 43) {
$fileName = $item.Subject -replace '[\\/:*?"<>|]', '_'
if ([string]::IsNullOrWhiteSpace($fileName)) {
$fileName = "NoSubject"
}
if ($fileName.Length -gt 150) {
$fileName = $fileName.Substring(0, 150)
}
$fullPath = Join-Path $TargetPath "$fileName.msg"
if (Test-Path $fullPath) {
$timestamp = $item.ReceivedTime.ToString("yyyyMMdd_HHmmss")
$fullPath = Join-Path $TargetPath "${fileName}_${timestamp}.msg"
}
$item.SaveAs($fullPath, $olMSG)
$script:counter++
Write-Host "Saved:$fullPath"
}
}
# Recurse into subfolders
foreach ($subfolder in $OutlookFolder.Folders) {
$subPath = Join-Path $TargetPath $subfolder.Name
Export-MailFolder -OutlookFolder $subfolder -TargetPath $subPath
}
}
# --- Run the export ---
$counter = 0
Export-MailFolder -OutlookFolder $posteingang -TargetPath $savePath
Write-Host "`nDone! $counter emails exported to $savePath"