myITforum and Windows IT Pro Forums
Forum Themes:
Welcome !

PowerShell Commands to Convert EDB file to PST file manually

Author Message
joeprior

  • Total Posts : 2
  • Scores: 0
  • Reward points : 250
  • Joined: 7/16/2015
  • Status: offline
PowerShell Commands to Convert EDB file to PST file manually Thursday, July 16, 2015 3:54 AM (permalink)
0
[Helpful answer received] / [List Solutions Only]
PowerShell is a command line tool used by Exchange Administrators for the purpose of task automatization. You can use this utility to convert EDB file to PST file format. Here I will discuss the PowerShell command to perform the conversion in Exchange 2010.
New-MailboxExportRequest cmdlet of powershell is used to perform the desired conversion. 
Syntax of Command: New-MailboxExportRequest –Mailbox type_mailbox_name –FilePath enter_the_folder_path _to_save_resultant_pst\abc.pst
The command will create a new PST file with the name abc.pst.
Note: The folder in which you want to save the file should be shared.
Example of the above command
New-MailboxExportRequest –Mailbox joe.prior –FilePath \\server\pstfile\abc.pst
Here joe,prior is the mailbox name, \\server\pstfile is the path of shared folder and abc.pst is the name of resultant PST file
Hope the post will be helpful for you
 
#1
    martylist

    • Total Posts : 76
    • Scores: 0
    • Reward points : 39000
    • Joined: 6/10/2005
    • Location: Colorado, USA
    • Status: offline
    Re:PowerShell Commands to Convert EDB file to PST file manually Thursday, July 16, 2015 10:33 AM (permalink)
    0
    [This post was marked as helpful]
    Here's a customized version of this script:
    http://www.stevieg.org/20...r-mass-exports-to-pst/
     
     
     
     # Exports multiple Exchange 2010 mailboxes to .PST files. 
     # Based on the Exchange 2010 SP1 Mailbox Export Script by Steve Goodman. http://www.stevieg.org/2010/07/using-the-exchange-2010-sp1-mailbox-export-features-for-mass-exports-to-pst/ 
     # ToDo: 
     #		Needs error checking added during the actual New-MailboxExportRequest section, in case the mailbox is on an earlier version of Exchange or the DB is unavailable. 
       
     ################ Settings ################ 
     # $ALiasList will export specific mailboxes.  $Server and $Database will export all mailboxes in that server or database. 
     # Configure only one of the options below. If you configure more than one, only $AliasList will be used. 
     $AliasList = @('User1','User2') 
     $Server = "" 
     $Database = "" 
       
     # Share to export mailboxes to. Needs R/W by Exchange Trusted Subsystem. Must be a UNC path as this is run by the CAS MRS service. 
     $ExportShare = "\\SERVER\Backups$\Exchange" 
       
     # After each run a report of the exports can be dropped into the directory specified below. (The user that runs this script needs access to this share)
     # Must be a UNC path or the full path of a local directory. 
     $ReportShare = "\\SERVER\Backups$\Exchange" 
     
     # Delete any existing PST file beforehand? (The user that runs this script needs access to the $ExportShare share) 
     # Valid values: $true or $false 
     $RemovePSTBeforeExport = $true 
     
     $ExitCode = -1 
     
     ################ Code ################ 
     if (!(Get-PSSnapin 'Microsoft.Exchange.Management.PowerShell.E2010' -ErrorAction SilentlyContinue)) 
     { 
     Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction Stop 
     } 
     
     # Make batch name 
     $Date = Get-Date -uformat "%Y-%m-%d_%H-%M" 
     $BatchName = "Export_$Date" 
       
     $Mailboxes = @() 
     
     if ($AliasList) 
     { 
      # If you want the script to fail if any of the names are not found, replace the foreach loop with this line:
       # 	$Mailboxes = $AliasList | Get-Mailbox -ResultSize $AliasList.Count
       #	Since the Get-Mailbox cmdlet does not seem to support the CommonParameters (i.e. -ErrorAction Continue), if the alias list has 
       # any bad names or an alias is changed/deleted in AD, the entire script fails. So the cmdlet makes continue on error overly complicated:
      
       foreach ($Alias in $AliasList)
       {
         $Mailbox = $Null
         # $Mailbox = (Get-Mailbox -Filter {Alias -eq $Alias} -ResultSize 1)
         $Mailbox = (Get-Mailbox -Identity $Alias -ResultSize 1)
         if ($Mailbox -ne $NUll)
         {
           $Mailboxes += $Mailbox
         } else {
           $Message = "ERROR: Failed to find a mailbox for the alias {0}.  Check the Alias in EMC or the mailNickname attribute in AD." -f $Alias
           Write-Output $Message
           if ($ReportShare)
           {
             Write-Output $Message | Out-File -FilePath "$($ReportShare)\$($BatchName)_Incomplete.txt" -Append
          }
        }
      }
    } 
     elseif ($Server) 
     {
       if (!(Get-ExchangeServer $Server -ErrorAction SilentlyContinue))
       {
         throw "Exchange Server $Server not found";
       }
       if (!(Get-MailboxDatabase -Server $Server -ErrorAction SilentlyContinue))
       {
         throw "Exchange Server $Server does not have mailbox databases";
       }
       $Mailboxes = Get-Mailbox -Server $Server -ResultSize Unlimited
     }
     elseif ($Database)
     {
       if (!(Get-MailboxDatabase $Database -ErrorAction SilentlyContinue))
       {
         throw "Mailbox database $Database not found"
       }
       $Mailboxes = Get-Mailbox -Database $Database
     }
      
     if ((!$Mailboxes) -Or ($Mailboxes.Count -lt 1)) 
     { 
       throw "No mailboxes found." 
     } 
     
     # Pre-checks done 
     
     Write-Output "Queuing $($Mailboxes.Count) mailboxes as batch '$($BatchName)'"
      
     # Queue all mailbox export requests
     foreach ($Mailbox in $Mailboxes)
     {
       if ($RemovePSTBeforeExport -eq $true -and (Get-Item "$($ExportShare)\$($Mailbox.Alias).pst" -ErrorAction SilentlyContinue))
       {
         Remove-Item "$($ExportShare)\$($Mailbox.Alias).pst" -Confirm:$false
       }
       New-MailboxExportRequest -BatchName $BatchName -Mailbox $Mailbox.Alias -FilePath "$($ExportShare)\$($Mailbox.Alias).pst"
     }
     
     Write-Output "Waiting for batch to complete"
     
     # Wait for mailbox export requests to complete
     while ((Get-MailboxExportRequest -BatchName $BatchName | Where-Object {$_.Status -eq "Queued" -or $_.Status -eq "InProgress"}))
     {
       Start-Sleep 60
     }
     
     # Write reports if required
     if ($ReportShare)
     {
       Write-Output "Writing reports to $($ReportShare)"
       $Completed = @()
       $Completed = Get-MailboxExportRequest -BatchName $BatchName | Where-Object {$_.Status -eq "Completed"}
       if ($Completed)
       {
         "Total Complete: {0}" -f $Completed.Count | Out-File -FilePath "$($ReportShare)\$($BatchName)_Complete.txt" -Append
         $Completed | Get-MailboxExportRequestStatistics | Format-List | Out-File -FilePath "$($ReportShare)\$($BatchName)_Complete.txt" -Append
         $ExitCode = 0
       }
       if (($AliasList) -And ($AliasList.Count -ne $Completed.Count))
       {
         $Message = "ERROR: Failed to match the number of aliases configured ({0}) with the number of exports completed ({1})." -f $AliasList.Count, $Completed.Count
         Write-Output $Message
         Write-Output $Message | Out-File -FilePath "$($ReportShare)\$($BatchName)_Incomplete.txt" -Append
         $ExitCode = $AliasList.Count - $Completed.Count
       }
       $Incomplete = @()
       $Incomplete = Get-MailboxExportRequest -BatchName $BatchName | Where-Object {$_.Status -ne "Completed"}
       if ($Incomplete)
       {
         "Total Incomplete: {0}" -f $Incomplete.Count | Out-File -FilePath "$($ReportShare)\$($BatchName)_Incomplete.txt" -Append
         $Incomplete | Get-MailboxExportRequestStatistics | Format-List | Out-File -FilePath "$($ReportShare)\$($BatchName)_Incomplete.txt" -Append
         $ExitCode = $Incomplete.Count
       }
     }
     
    
     # Remove Requests
     Write-Output "Removing requests created as part of batch '$($BatchName)'"
     Get-MailboxExportRequest -BatchName $BatchName | Remove-MailboxExportRequest -Confirm:$false
      
     Exit $ExitCode
    


    <message edited by martylist on Thursday, July 30, 2015 9:39 AM>
     
    #2
      kayerjenkins

      • Total Posts : 1
      • Scores: 0
      • Reward points : 100
      • Joined: 9/17/2015
      • Status: offline
      Re:PowerShell Commands to Convert EDB file to PST file manually Thursday, September 17, 2015 3:19 AM (permalink)
      0
      Check out Steps to Move Exchange Server Mailbox (EDB) to Ms Outlook (PST) file format,just visit the given link here:  exchangeserverstips.wordpress.com/2013/12/16/steps-to-move-exchange-server-mailbox-to-higher-version
      <message edited by kayerjenkins on Thursday, September 17, 2015 3:24 AM>
       
      #3
        JohnAutry

        • Total Posts : 1
        • Scores: 0
        • Reward points : 100
        • Joined: 8/26/2016
        • Status: offline
        Re:PowerShell Commands to Convert EDB file to PST file manually Friday, August 26, 2016 2:29 AM (permalink)
        0
        When your EDB file as been cropputed and you want get back all data so dont worry just try this It can easily Convert EDB to PST File and smartly recover all mails from EDB file to Outlook file without facing any problem. With this program auto finds EDB file position with restore 25 Emails from EDB file to PST (Outlook), MSG, EML and HML. This tool professionally works on all Exchange EDB file version such as: - 5.0 as 2016.
         
        #4
          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 2 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2017 ASPPlayground.NET Forum Version 3.9