Share via


Set-ScannerContentScan

Defines settings for an Microsoft Purview Information Protection scanner content scan job.

Syntax

Default (Default)

Set-ScannerContentScan
    [-Schedule <Schedule>]
    [-DiscoverInformationTypes <DiscoverInformationTypes>]
    [-RecommendedAsAutomatic <OnOffEnum>]
    [-EnableDlp <OnOffEnum>]
    [-Enforce <OnOffEnum>]
    [-LabelFilesByContent <OnOffEnum>]
    [-RelabelFiles <OnOffEnum>]
    [-AllowLabelDowngrade <OnOffEnum>]
    [-EnforceDefaultLabel <OnOffEnum>]
    [-DefaultLabelType <DefaultLabelType>]
    [-DefaultLabelId <Guid>]
    [-DefaultOwner <String>]
    [-RepositoryOwner <String>]
    [-PreserveFileDetails <OnOffEnum>]
    [-IncludeFileTypes <String>]
    [-ExcludeFileTypes <String>]
    [-WhatIf]
    [-Confirm]

Description

Defines the configuration for your content scan job, which scans the content in the defined repositories, according to the settings defined. For more information about content scan jobs, see the Microsoft Purview Information Protection on-premises scanner documentation.

Examples

Example 1 Define default content scan job settings

PS C:\WINDOWS\system32> Set-ScannerContentScan -Enforce Off

This example defines the content scan job with default settings, and sets the Policy enforcement option to Off.

Example 2 Define a basic content scan job that runs continuously

PS C:\WINDOWS\system32> Set-ScannerContentScan -Enforce Off -RelabelFiles On -EnforceDefaultLabel On -Schedule Always

This example defines the content scan job with without enforcing a policy, allowing files to be re-labeled, using a default label, and is scheduled to run always.

Example 3 Define a content scan job that allows for specific re-labeling actions only

PS C:\WINDOWS\system32> Set-ScannerContentScan -RelabelFiles On -AllowLabelDowngrade On -EnforceDefaultLabel On

This example defines a content scan job that allows for content to be re-labeled only to downgrade a label or use a default label.

Example 4 Define a content scan job that excludes .msg and .tmp files

PS C:\WINDOWS\system32> Set-ScannerContentScan -IncludeFileTypes '' -ExcludeFileTypes '.msg,.tmp'

This example defines a content scan job that includes all file types except for .msg and .tmp files.

Example 5 Define a content scan job with DLP enabled, and a specific repository owner

PS C:\WINDOWS\system32> Set-ScannerContentScan -EnableDLP On -RepositoryOwner 'domain\user'

This example defines the content scan job to use the Microsoft Purview data loss prevention (DLP) sensitivity information types when scanning your content, and also defines a specific owner for the content scan job's repositories.

Example 6 Define a content scan job with a default label to use when automatically labeling content

PS C:\WINDOWS\system32> Set-ScannerContentScan -DefaultLabelType Custom -DefaultLabelId 'ff1f1c9d-2f92-4a18-3d84-4608b742424'

This example defines the content scan job with a specific label used as the default label, specified by the label ID.

Parameters

-AllowLabelDowngrade

Determines whether the content scan job allows for labeling downgrade actions.

Relevant only when the RelabelFiles parameter is set to on.

Parameter properties

Type:OnOffEnum
Default value:None
Accepted values:On, Off
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultLabelId

Defines the ID of the default label used when automatically labeling content with a default label.

Mandatory if the DefaultLabelType parameter is set to custom.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultLabelType

Determines the type of default label used when automatically labeling content with a default label.

When used, define the label ID you want to use as the default ID using the DefaultLabelId parameter.

Parameter properties

Type:DefaultLabelType
Default value:None
Accepted values:None, PolicyDefault, Custom
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultOwner

Defines the default owner value used for the files scanned, using the account email address. By default, this is the scanner account.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DiscoverInformationTypes

Determines the types of information types discovered during the content scan job.

Parameter properties

Type:DiscoverInformationTypes
Default value:None
Accepted values:PolicyOnly, All
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableDlp

Determines whether the content scan job uses the data loss prevention (DLP) sensitivity information types when scanning your content.

Tip

If you configure this parameter, you may also want to configure a specific repository owner using the RepositoryOwner parameter.

Parameter properties

Type:OnOffEnum
Default value:None
Accepted values:On, Off
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enforce

Determines whether the content scan job enforces content scanning and labeling according to your policy.

Parameter properties

Type:OnOffEnum
Default value:None
Accepted values:On, Off
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnforceDefaultLabel

Determines whether using a default label is always used when relabeling content.

Relevant only when the RelabelFiles parameter is set to on.

Parameter properties

Type:OnOffEnum
Default value:None
Accepted values:On, Off
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExcludeFileTypes

Determines any file types that are ignored during your content scan job. Define multiple file types using a comma-separated list.

If you define this parameter, define the IncludeFileTypes parameter as null. For example, Example 4 above.

Relevant only when the OverrideContentScanJob parameter is set to on in the Add-ScannerRepository or Set-ScannerRepository cmdlets.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeFileTypes

Explicitly determines the file types that are scanned by your content scan job. Define multiple file types using a comma-separated list.

If you define this parameter, define the ExcludeFileTypes parameter as null. For example, Example 4 above.

Relevant only when the OverrideContentScanJob parameter is set to on in the Add-ScannerRepository or Set-ScannerRepository cmdlets.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LabelFilesByContent

Determines whether the Label files based on content content scan job option is enabled or disabled.

Parameter properties

Type:OnOffEnum
Default value:None
Accepted values:On, Off
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PreserveFileDetails

Determines whether the file details, including the date modified, last modified, and modified by settings are preserved while scanning and auto-labeling.

Parameter properties

Type:OnOffEnum
Default value:None
Accepted values:On, Off
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecommendedAsAutomatic

Determines whether recommended labels are used to automatically label your content.

Parameter properties

Type:OnOffEnum
Default value:None
Accepted values:On, Off
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RelabelFiles

Determines whether the content scan job is allowed to relabel files.

Tip

When using this parameter, use the following additional parameters as needed:

  • EnforceDefaultLabel
  • AllowLabelDowngrade

Parameter properties

Type:OnOffEnum
Default value:None
Accepted values:On, Off
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RepositoryOwner

Specifies the SAMAccountname (domain\user), UPN (user@domain), or SID of a group that owns the repository.

The owners are granted full control permissions on the file if the permissions on the file are changed by a matched DLP rule.

Relevant only when the EnableDlp parameter is set to on.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Schedule

Determines whether the content scan job runs according to a specific schedule, or continuously.

Parameter properties

Type:Schedule
Default value:None
Accepted values:Manual, Always
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

Inputs

None

Outputs

System.Object