Need to install outlook client on the box you want to run the script on.
EXCTOPST.bat file ---->
@echo off
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\bin\exshell.psc1" -command C:\Scripts\user.ps1
pause
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\bin\exshell.psc1" -command C:\Scripts\user.ps1
pause
______________________________________________________
user.ps file......
$id = read-host "Enter the username"
$PSTPath = read-host "Enter the pst pathname E:\Temp\"
get-mailbox -identity $id | Export-Mailbox -PSTFolderPath $PSTPath
Write-host -fore Yellow "Check the STATUS MESSAGE to see if successfull or any errors have occured. Then PRESS ANY KEY to Continue"
$PSTPath = read-host "Enter the pst pathname E:\Temp\"
get-mailbox -identity $id | Export-Mailbox -PSTFolderPath $PSTPath
Write-host -fore Yellow "Check the STATUS MESSAGE to see if successfull or any errors have occured. Then PRESS ANY KEY to Continue"