Share via


Add-ScannerRepository

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

Syntax

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
Type:OnOffEnum
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:DefaultLabelType
Accepted values:None, PolicyDefault, Custom
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:OnOffEnum
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:OnOffEnum
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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
Type:OnOffEnum
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:OnOffEnum
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:OnOffEnum
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Path

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

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters: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.

Type:OnOffEnum
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RelabelFiles

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

Relevant only when the OverrideContentScanJob parameter is set to on.

Type:OnOffEnum
Accepted values:On, Off
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object