New-FsrmFileScreenTemplate

Creates a file screen template.

Syntax

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

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.

Examples

Example 1: Create a passive file screen template

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

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.

Example 2: Create an active file screen template

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

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.

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.

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

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet.

For more information about Windows PowerShell background jobs, see about_Jobs.

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

-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.

Type:CimSession[]
Aliases:Session
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:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies a description for the file screen template.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IncludeGroup

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

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name for the file screen template.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Notification

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

Type:CimInstance[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ThrottleLimit

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.

Type:Int32
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:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

CimInstance[]

Outputs

Object