Set-SmJob

Detailed Description

The Set-SmJob cmdlet empowers you to modify attributes of a job or jobs.

Syntax

Set-SmJob 
[[-JobId] <int[]>] 
[-Job <IJob[]>] 
[-BatchId <int>] 
[-Batch <Batch>] 
[-SourceCredential <pscredential>]
[-TargetCredential <pscredential>] 
[-DateFrom <datetime>] 
[-DateTo <datetime>] 
[-Priority <int>] 
[-JobConfig <IJobConfig>] 
[-SourceOptions {Ex2007 | Ex2010 | Ex2010sp1 | Ex2010sp2 | Ex2013 | Ex2013sp1 | Ex2016 | UseArchive | EVRehydrate | EVJournal | IncludeHold | KeepStub | EVUseSQL | ZantasRehydrate |
UseHostedArchive | IgnoreNetworkDrives | NoDiscoveryAnalysis | EnableEwsTrace | ExtractJournalAttach | UseStream | UseFullTextSearch | MoveItem | DetailedPfDiscovery | ScanArchives}] 
[-TargetOptions {Ex2007 | Ex2010 | Ex2010sp1 | Ex2010sp2 | Ex2013 | Ex2013sp1 | Ex2016 | UseArchive | EnqueueOnly | DeDupe | Bulk | UseHostedArchive | EnableEwsTrace | UseStream | MoveItem }] 
[-ResetJob] 
[-SourceParams <string>] 
[-TargetParams <string>]
[-SourceAutodiscoverUrl <string>] 
[-TargetAutodiscoverUrl <string>] 
[-SourceRefreshToken <string>]
[-TargetRefreshToken <string>] 
[-Schedules <int[]>] 
[-Tags <string>] 
[-TargetOutput <string>] 
[-MaxPSTSize <int>]
[-TargetFolder <string>] 
[-SourceEwsUrl <string>] 
[-TargetEwsUrl <string>] 
[-SourceAuthCode <string>]
[-TargetAuthoCode <string>]  
[<CommonParameters>]

Parameters

    -Batch <Batch>
        Specify Batch

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

    -BatchId <int>
        Specify BatchId

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -DateFrom <datetime>
        Specify date to migrate items from

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -DateTo <datetime>
        Specify date to migrate items to

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -Job <IJob[]>
        Provide Job(s) from pipeline

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

    -JobConfig <IJobConfig>
        Provide a job specific configuration.

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -JobId <int[]>
        Specify one or more JobId's

        Required?                    false
        Position?                    0
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -MaxPSTSize <int>
        Specify maximum output file size in Megabytes, e.g. 1000

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      MaxFileSize
        Dynamic?                     false

    -Priority <int>
        Specify job priority as an integer (higher is better)

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -ResetJob
        Use this option to reset the job - this will clear any discovered items and trigger rediscovery and
        re-processing of all items.

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -Schedules <int[]>
        Associate job with one or more schedules

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -SourceAuthCode <string>
        Set or remove the SourceAuthoCode

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -SourceAutodiscoverUrl <string>
        Provide a specific Exchange autodiscover URL to use in place of the default autodetection.

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -SourceCredential <pscredential>
        Specify the source credentials to use

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -SourceEwsUrl <string>
        Provide the source Exchange Web Service Url (O365 default https://outlook.office365.com/EWS/Exchange.asmx)

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -SourceOptions <SourceOptions[]>
        Specify source options for this job - these will OVERWRITE all other options

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -SourceParams <string>
        Provide additional source parameters as a JSON string

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -SourceRefreshToken <string>
        OAuth 2 Refresh Token

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -Tags <string>
        Tag this job with #tag1,#tag2 style comma-separated tags

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -TargetAuthoCode <string>
        Set or remove the TargetAuthoCode

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -TargetAutodiscoverUrl <string>
        Provide a specific Exchange autodiscover URL to use in place of the default autodetection.

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -TargetCredential <pscredential>
        Specify the source credentials to use

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -TargetEwsUrl <string>
        Provide the target Exchange Web Service Url (O365 default https://outlook.office365.com/EWS/Exchange.asmx)

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -TargetFolder <string>
        Specify root folder in target to save under (default is the root folder)

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -TargetOptions <TargetOptions[]>
        Specify source options for this job - these will OVERWRITE all other options

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -TargetOutput <string>
        Specify target item identity or filename

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      TargetFile, TargetMailbox, TargetPst
        Dynamic?                     false

    -TargetParams <string>
        Provide additional target parameters as a JSON string

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        Aliases                      None
        Dynamic?                     false

    -TargetRefreshToken <string>
        OAuth 2 Refresh Token

        Required?                    false
        Position?                    Named
        Accept pipeline input?       false
        Parameter set name           DefaultParameterSetName
        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 (https:/go.microsoft.com/fwlink/?LinkID=113216).

Examples

Set-SMJob is used to modify jobs that are set for Migration, Discovery or Reporting.

An example how to reset your Source Credentials for a job;

PS C:\Simply Migrate>$creds = Get-Credential
PS C:\Simply Migrate>Set-SMJob -JobId 10 -SourceCredential $creds
JobId : 10
BatchId :
JobStatus : Created
TimeStarted :
TimeFinished :
Source : Exchange
Target : PSTFile
SourceType : {"srcmailbox":"user@domain.com"}
TargetType : {"targpst":"C:\\Folder\\PSTFile.pst"}
DateFrom : 1/1/1900 12:00:00 AM
DateTo : 1/1/2100 12:00:00 AM
ItemsTotal :
ItemsFailed : 0
ItemsRemaining : 0
FailedCount : 0
Params :
SMVersion : X.X.X.XXXX
JobCreatedBy : USER_CONTEXT_USERNAME
JobModifiedBy : USER_CONTEXT_USERNAME
ProcessingInBatch :
SourceParams : {[srcmailbox, user@domain.com]}
TargetParams : {[targpst, C:\Folder\PSTFile.pst]}
PercentComplete : 0
SourceMailbox : user@domain.com
TargetMailbox : PSTFile.pst

NOTE: When a job is modified by a Set-SMJob, the ModifiedBy attribute is updated to reflect the username of the user who modified the Job.