Condividi tramite


New-FsrmFileScreen

New-FsrmFileScreen

Creates a file screen.

Syntax

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

Detailed Description

The New-FsrmFileScreen cmdlet creates a file screen for a path on the server. A file screen blocks users from saving groups of files to a specified folder.

If you specify the Active parameter, the file screen prevents users from saving files that are members of blocked file groups, and generates notifications when users try to save blocked files. The file screen does not prevent users and applications from accessing files that were saved to the path before the file screen was created, regardless of whether the files are members of blocked file groups.

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.

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. The file groups contain the file name patterns that the server uses to specify the files that are blocked by this screen.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-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

-Path<String>

Specifies a valid local path to a folder.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

true

-Template<String>

Specifies a file screen template on the server.

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_FSRMFileScreen

Examples

Example 1: Create a passive file screen

This command creates a passive file screen on C:\Shares 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-FsrmFileScreen -Path "C:\Shares" -Description "Filter Non-HTML text files" –IncludeGroup "Non-HTML text files"

Example 2: Create an active file screen

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 on C:\Shares\Ctrshare03 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-FsrmFileScreen -Path "C:\Shares\Ctrshare03" –IncludeGroup "Non-HTML text files" -Notification $Notification -Active

Example 3: Create a file screen from a file screen template

This command creates a file screen on C:\shares\ctrshare03 based on the settings in the "Block Image Files" template.

PS C:\> New-FsrmFileScreen -Path "C:\shares\ctrshare03" –Template "Block Image Files"

Get-FsrmFileScreen

Set-FsrmFileScreen

Reset-FsrmFileScreen

Remove-FsrmFileScreen

New-FsrmFmjNotificationAction

Get-FsrmFileGroup