Share via


Add-ScannerRepository

Adds a repository to a Microsoft Purview Information Protection scanner content scan job.

Syntax

Default (Default)

Add-ScannerRepository
    -Path <String>
    [-OverrideContentScanJob <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]
    [<CommonParameters>]

Description

Adds a repository for your content scan job to scan.

Examples

Example 1 Add a new repository using the configured content scan jobs settings

PS C:\WINDOWS\system32> Add-ScannerRepository -Path 'c:\repoToScan'

This example adds the repoToScan repository to your content scan job, using the content scan job's current settings.

Example 2 Add a new repository, overriding the content scan job's current settings

PS C:\WINDOWS\system32> Add-ScannerRepository -Path 'c:\repoToScan' -OverrideContentScanJob On -Enforce On -DefaultOwner 'ms@gmail.com'

This example adds the repoToScan repository to your content scan job, overriding the currently configured content scan job settings.

Example 3 Add a new repository, excluding .msg and .tmp files

PS C:\WINDOWS\system32> Add-ScannerRepository -Path 'c:\repoToScan' -OverrideContentScanJob On -IncludeFileTypes '' -ExcludeFileTypes '.msg,.tmp'

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

Parameters

-AllowLabelDowngrade

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

Relevant only when the following parameters are set to on:

  • OverrideContentScanJob
  • RelabelFiles

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.

  • Relevant only when the OverrideContentScanJob parameter is set to on.

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.

Relevant only when the OverrideContentScanJob parameter is set to on.

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.

Relevant only when the OverrideContentScanJob 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

-EnableDlp

Determines whether the content scan job uses the Microsoft Purview 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.

Relevant only when the OverrideContentScanJob 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

-Enforce

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

Relevant only when the OverrideContentScanJob 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

-EnforceDefaultLabel

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

Relevant only when the following parameters are set to on:

  • RelabelFiles
  • OverrideContentScanJob

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, see Example 3 above.

Relevant only when the OverrideContentScanJob 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

-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, see Example 3 above.

Relevant only when the OverrideContentScanJob 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

-LabelFilesByContent

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

Relevant only when the OverrideContentScanJob 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

-OverrideContentScanJob

Determines whether the settings for this repository override the settings defined for the content scan job.

If set to On, define any settings you want to override using additional parameters.

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

-Path

Defines the path to the repository you want to add to the content scan job.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:True
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.

Relevant only when the OverrideContentScanJob 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

-RelabelFiles

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

Relevant only when the OverrideContentScanJob 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

-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 following parameters are set to on.

  • OverrideContentScanJob
  • EnableDlp

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

-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

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object