Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Create a Progress Bar using Write-Progress for bulk New-mailboxImportRequests

$
0
0

I am doing some bulk PST imports using New-MailboxImportRequest.  Just FYI, this is the command I used:

Dir "\\PATHNAME\*.pst" | %{ New-MailboxImportRequest -Name RecoveredPST -BatchName JPDETW -Mailbox $_.BaseName -FilePath $_.FullName  -BadItemLimit 5000 -AcceptLargeDataLoss}

I can get the status shown in percentage complete by running:  Get-MailboxImportRequest -name recoveredPST | Get-MailboxImportRequestStatisticswhich outputs the coulumsn Name, Status, TargetAlias, PercentComplete, but have to run it manually ad hoc

I would love to make this status into automated message and status bar using Write-Progress.  I could add up the contents of the PercentComplete column returned ($SUMlPercentComplete), then divide by the number of items in that column, to get a total percentage complete ($TotalPercentComplete) for all mailboxes, then pipe that into write-progress.  The only problem is that I read Write-Progress doesnt accept inputs from pipes.

If Ran a timed command that ran every 5 seconds until TotalPercentComplete= 100 then maybe that would work?

Anyone have any really fun ideas on this? :-)


-- Ron Williams http://www.r0nwilliams.com


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>