Exchange Hybrid Mailbox Migrations - Skipped Items script

Scott Grossman 41 Reputation points
2024-04-28T19:02:13.5233333+00:00

I have a script that I'm working on to get query the entire batch, grab the users, then get the skipped items. This one works, but it crams the expanded skipped items in one line for one user. How can I modify this so it puts each skipped item for one user in a seperate line?

$MigrationUser=Get-MigrationUser -batchid b40af8ae-d4fd-4208-a085-ac1bd76f126 -resultsize unlimited

$Results = foreach( $Mailbox in $migrationuser ){

    $Stats = Get-migrationuserstatistics -Identity $Mailbox -includeskippeditems | ?{$_.skippeditems -ne $null} | select-object -expandproperty skippeditems

    New-Object -TypeName psobject -Property @{

        Name                    = $migrationuser.identity

      RuleName            = $Stats.subject

      Type               = $stats.kind

        }

    }

$Results | ft  name,rulename,type -autosize > c:\temp\migrationrules.csv

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,664 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
545 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
2,113 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.