Compartilhar via


New-FsrmFileScreenTemplate

New-FsrmFileScreenTemplate

Creates a file screen template.

Syntax

Parameter Set: cim:CreateInstance0
New-FsrmFileScreenTemplate [-Name] <String> [-Active] [-AsJob] [-CimSession <CimSession[]> ] [-Description <String> ] [-IncludeGroup <String[]> ] [-Notification <CimInstance[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The New-FsrmFileScreenTemplate cmdlet creates a file screen template. A file screen template defines the group of file groups to block, the type of screening to perform (active or passive), and the set of notifications that the file screen generates.

You can use file screen templates to centrally manage your file screens by updating the templates instead of the individual file screens. When you make changes to a template, you can choose to apply those changes to all file screens that are based on that template or only to the file screens whose properties match those in the template.

Parameters

-Active

Indicates that the server will fail any I/O operation that violates the file screen. If you do not specify this parameter, the server does not fail violating I/O operations and still runs any action that is associated with the file screen.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

Session

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

Specifies a description for the file screen template.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IncludeGroup<String[]>

Specifies an array of names of file groups that you want to exclude from file screening.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name for the file screen template.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

true

-Notification<CimInstance[]>

Specifies an array of notification action objects. You can use the New-FsrmFmjNotificationAction cmdlet to create a FsrmFmjNotificationAction object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Management.Infrastructure.CimInstance#MSFT_FSRMFileScreenTemplate

Examples

Example 1: Create a passive file screen template

This command creates a passive file screen template named "Filter Non-HTML text files" that logs any files that match the "Non-HTML text files" file group. The file screen template is passive because the command does not specify the Active parameter. This means that users can create non-HTML text files.

PS C:\> New-FsrmFileScreenTemplate "Filter Non-HTML text files" –IncludeGroup "Non-HTML text files"

Example 2: Create an active file screen template

The first command creates a File Server Resource Manager (FSRM) action object and stores the results in the $Notification variable. The action sends an email notification to the file owner and administrator. The RunLimitInterval parameter specifies an interval of 2 minutes before the server can send the email notification again.

This second command creates an active file screen template named "Filter Non-HTML text files" that restricts any files that match the Non-HTML text files file group. When a user attempts to create a non-HTML text file, the file screen performs the notification action stored in the $Notification variable.

PS C:\> $Notification = New-FsrmAction -Type Email -MailTo "[Admin Email];[File Owner]" -Subject “Warning: attempted to create a non-HTML text file” -Body “You attempted to create a non-HTML text file. This is not allowed.” -RunLimitInterval 120
PS C:\> New-FsrmFileScreenTemplate -Name "Filter Non-HTML text files" –IncludeGroup "Non-HTML text files" -Notification $Notification -Active

Get-FsrmFileScreenTemplate

Set-FsrmFileScreenTemplate

Remove-FsrmFileScreenTemplate

New-FsrmAction