Get-SmBatch

Detailed Description

The Get-SmBatch cmdlet is used to view a Simply Migrate Batch or Batches that have been created.

Syntax

Get-SmBatch [[-BatchId] <int[]>] [-ShowJobs] [-IsActive] [<CommonParameters>]

Parameters

-BatchId <int[]>
    Specify BatchId(s) (comma separated)

    Required? false
    Position? 0
    Accept pipeline input? false
    Parameter set name (All)
    Aliases None
    Dynamic? false

-IsActive
    Show all active batches

    Required? false
    Position? Named
    Accept pipeline input? false
    Parameter set name (All)
    Aliases None
    Dynamic? false

-ShowJobs
    Return the jobs in this batch.

    Required? false
    Position? Named
    Accept pipeline input? false
    Parameter set name (All)
    Aliases None
    Dynamic? false

<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Examples

Get-SmBatch is used to view a batch or batches that are set for Migration, Discovery or Reporting.
In the below example, you will see the configuration of a specific BatchId;

PS C:\Program Files\Simply Migrate> Get-SmBatch -BatchID 1
BatchId     : 1
BatchName   : The Friendly Batch Name
CreatedDate : 8/2/2015 09:40:00 AM
Jobs        : {1,2,3,4,5}
IsActive    : False
InProgress  :
Schedules   : {}

In the below example you will see all your batches;

PS C:\Program Files\Simply Migrate> Get-SmBatch
BatchId     : 1
BatchName   : The Friendly Batch Name
CreatedDate : 8/2/2015 09:40:00 AM
Jobs        : {1,2,3,4,5}
IsActive    : False
InProgress  :
Schedules   : {}

BatchId     : 2
BatchName   : The Second Friendly Batch Name
CreatedDate : 9/2/2015 09:40:00 AM
Jobs        : {6,7,8,9,10}
IsActive    : False
InProgress  :
Schedules   : {}

BatchId     : 3
BatchName   : The Third Friendly Batch Name
CreatedDate : 10/2/2015 09:40:00 AM
Jobs        : {11,12,13,14,15}
IsActive    : False
InProgress  :
Schedules   : {}

In this example you can get the job configuration of each job inside a batch easily. Simply add the -ShowJobs parameter to the cmdlet.

PS C:\Program Files\Simply Migrate> Get-SmBatch 1 -ShowJobs

JobId               : 1
BatchId             : 1
JobStatus           : Processing
StatusMessage       :
Priority            : 10
PercentComplete     : 0
TimeStarted         : 9/19/2016 09:40:00 AM
TimeFinished        : 9/19/2016 09:42:30 PM
SourceMailbox       : user@simplymigrate.me
TargetMailbox       : user@simplymigrate.me
Source              : Exchange
Target              : Exchange
DateFrom            : 1/1/1900 12:00:00 AM
DateTo              : 1/2/2100 12:00:00 AM
ItemsTotal          : 1483256
ItemsFailed         : 0
ItemsRemaining      : 1643
FailedCount         : 0
JobCreatedBy        : Bob_the_Builder
....... TRUNCATED ...........

JobId               : 2
BatchId             : 10
JobStatus           : Complete
StatusMessage       : Currently processing discovered file '\\.........'
Priority            : 10
PercentComplete     : 100
TimeStarted         : 9/19/2016 09:40:00 PM
TimeFinished        : 9/19/2016 09:42:30 PM
SourceMailbox       : Discovery
TargetMailbox       : Discovery
Source              : Discovery
Target              : Discovery
DateFrom            : 1/1/1900 12:00:00 AM
DateTo              : 1/2/2100 12:00:00 AM
ItemsTotal          : 326543
ItemsFailed         : 0
ItemsRemaining      : 0
FailedCount         : 0
JobCreatedBy        : Eric_The_Erector
....... TRUNCATED ...........

An example that will display a table of the job attributes specified, allowing for very quick management reports or jobs status reports;

Get-SmBatch 10 -ShowJobs | ft JobId, SourceMailbox, TargetMailbox, JobStatus, ItemsTotal, ItemsRemaining, PercentComplete