Skip to main content

Export-MessagesToPST

SYNOPSIS

This function exports a users mailbox to a pst.

SYNTAX

Export-MessagesToPST [-TargetUserAlias] <String> [[-ExportPath] <String>]
[<CommonParameters>]

DESCRIPTION

This function exports a users mailbox to a pst.

EXAMPLES

EXAMPLE 1

Export-MessagesToPST -TargetUserAlias joe.snuffy

Exports joe.snuffy's mailbox to C:\Users\Desktop\joe.snuffy_mailboxyyyyMMddhhmm.pst where yyyyMMddhhmm is the date and time the mailbox was exported.

EXAMPLE 2

Export-MessagesToPST -TargetUserAlias joe.snuffy -ExportPath "c:\test"

Exports joe.snuffy's mailbox to C:\test\joe.snuffy_mailboxyyyyMMddhhmm.pst where yyyyMMddhhmm is the date and time the mailbox was exported.

PARAMETERS

-TargetUserAlias

Mandatory parameter. Specify the users alias in Exchange or primary smtp address.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExportPath

By default saves to the logged on users desktop. You can specify where to save the pst to.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: ([System.Environment]::GetFolderPath("Desktop"))
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Object

NOTES

ALIASES

None.

PLATFORM APPLICABILITY

Windows only. The platform-aware loader does not export this command on Linux or macOS.

POWERSHELL COMPATIBILITY

See PowerShell compatibility for the supported runtime policy. PowerShell 7.6 LTS is preferred.

https://docs.keldor.dev/powershell/keldor/Export-MessagesToPST