none
Exchange 2007 export mailbox to pst UPN as filename RRS feed

  • Question

  • Hi,I need to export spesific mailboxes to PST but I need the PST names to be userprincipalname or primarySMTPAddress of the user.

    Get-mailbox |Where {$_.UserPrincipalName -like "*test.com*"} | .....

    How can I do this?


    Those who are skilled in combat do not become angered, those who are skilled at winning do not become afraid. Thus the wise win before the fight, while the ignorant fight to win.

    Tuesday, May 21, 2013 7:43 AM

All replies

  • Hi Evren,

    Normally, exported PST is named after the mailbox alias.
    I think you can rename the PST files after they have been exported. Please take a look on the methods in the threads below.

    http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/4c13ec0d-074f-4cc9-99ea-826c7a9a84f5
    http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/46698cb8-a678-4808-996a-73ba83fee096

    Thanks.

    Tuesday, May 21, 2013 8:29 AM
  • Thank you but I don't want to use csv file.


    Those who are skilled in combat do not become angered, those who are skilled at winning do not become afraid. Thus the wise win before the fight, while the ignorant fight to win.

    Tuesday, May 21, 2013 10:19 AM
  • What is the command or script you are using to export.

    How are you feeding the specific user names to the cmdlet.

    Can you confirm if the file names that are getting created are actually 'UserAlias.PST'

    Tested below commands sucessfully: You can put it in a .PS1 file and run or run both command together simulteneously.

    -----------------------------------------------------------------------

    $H = get-mailbox -identity UserUPNhere
    get-mailbox -identity UserUPNhere | export-csv $("R:\Testexport\"+$H.UserPrincipalName+".csv")

    -----------------------------------------------------------------------

    Hence below command should working too:

    $H = get-mailbox -identity UserUPNhere
    Export-Mailbox -Identity UserUPNhere -PSTFolderPath $("R:\Testexport\"+$H.UserPrincipalName+".PST")

    Here the mailbox is called twice once to get the variable updated for filename and second for actually exporting it to the file.


    Satyajit - Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.


    • Edited by Satyajit321 Tuesday, May 28, 2013 2:56 PM Added tested PS Code
    Tuesday, May 28, 2013 2:02 PM