Forum Discussion

Nigel_Price9911's avatar
Nigel_Price9911
Iron Contributor
Dec 19, 2017

Search-mailbox creates .csv contains the emails, but does not copy them

Hi

 

 I am using the search-mailbox power shell command to copy / move emails between two email mailboxes.

 

i run the command, I get told it found 550 emails size 128.9Mb.  A .csv file is created but no emails are found in the destination email box.

 

the command I used is :-

 

Search-Mailbox $sourceusername -SearchQuery “$date”  -TargetMailbox  “$TargetUserName” -TargetFolder “$TargetFolderName” -LogLevel Full

 

Thanks

 

Nigel

 

 

3 Replies

  • All emails copied into source folder (which named as <username>) in target folder. For example i copy mails from admin to alexw draft folder, after finish copy process new folder will be created with name of admin in draft folder.

     

    you can use following command to get count item of target folder.

    Get-MailboxFolderStatistics alexw |select name,folderpath,ItemsInFolder

     

    • Nigel_Price9911's avatar
      Nigel_Price9911
      Iron Contributor

      Thanks

       

      They have appeared now.

       

      It must of taken a while for them to appear.

       

      I will wait next time.

       

      Regards

       

      Nigel

  • It might take a while for the results to appear, especially if you are looking at the target mailbox in a cached Outlook profile. Try looking via OWA instead.