Skip to content

FSRMFileScreenAction

dscbot edited this page Jun 16, 2024 · 3 revisions

FSRMFileScreenAction

Parameters

Parameter Attribute DataType Description Allowed Values
Path Key String The path of the FSRM File Screen the action applies to.
Type Key String The type of FSRM Action. Email, Event, Command, Report
Ensure Write String Specifies whether the FSRM Action should exist. Present, Absent
Subject Write String The subject of the e-mail sent. Required when Type is Email.
Body Write String The body text of the e-mail or event. Required when Type is Email or Event.
MailTo Write String The mail to of the e-mail sent. Required when Type is Email.
MailCC Write String The mail CC of the e-mail sent. Required when Type is Email.
MailBCC Write String The mail BCC of the e-mail sent. Required when Type is Email.
EventType Write String The type of event created. Required when Type is Event. None, Information, Warning, Error
Command Write String The Command to execute. Required when Type is Command.
CommandParameters Write String The Command Parameters. Required when Type is Command.
KillTimeOut Write SInt32 Int containing kill timeout of the command. Required when Type is Command.
RunLimitInterval Write SInt32 Int containing the run limit interval of the command. Required when Type is Command.
SecurityLevel Write String The security level the command runs under. Required when Type is Command. None, LocalService, NetworkService, LocalSystem
ShouldLogError Write Boolean The working directory of the command. Required when Type is Command.
WorkingDirectory Write String The type of event created. Required when Type is Event.
ReportTypes Write StringArray[] Array of Reports to create. Required when Type is Report.

Description

This resource is used to configure File Screen Actions for File Screens in File Server Resource Manager.

Examples

Example 1

This configuration will assign an Active FSRM File Screen to the path 'D:\Users' with three include groups. An e-mail and event action is bound to the File Screen.

Configuration FSRMFileScreenAction_Config
{
    Import-DscResource -Module FSRMDsc

    Node localhost
    {
        FSRMFileScreen DUsersFileScreen
        {
            Path         = 'd:\users'
            Description  = 'File Screen for Blocking Some Files'
            Ensure       = 'Present'
            Active       = $true
            IncludeGroup = 'Audio and Video Files', 'Executable Files', 'Backup Files'
        } # End of FSRMFileScreen Resource

        FSRMFileScreenAction DUsersFileScreenSomeFilesEmail
        {
            Path      = 'd:\users'
            Ensure    = 'Present'
            Type      = 'Email'
            Subject   = 'Unauthorized file matching [Violated File Group] file group detected'
            Body      = 'The system detected that user [Source Io Owner] attempted to save [Source File Path] on [File Screen Path] on server [Server]. This file matches the [Violated File Group] file group which is not permitted on the system.'
            MailBCC   = ''
            MailCC    = '[email protected]'
            MailTo    = '[Source Io Owner Email]'
            DependsOn = "[FSRMFileScreen]DUsersFileScreen"
        } # End of FSRMFileScreenAction Resource

        FSRMFileScreenAction DUsersFileScreenSomeFilesEvent
        {
            Path      = 'd:\users'
            Ensure    = 'Present'
            Type      = 'Event'
            Body      = 'The system detected that user [Source Io Owner] attempted to save [Source File Path] on [File Screen Path] on server [Server]. This file matches the [Violated File Group] file group which is not permitted on the system.'
            EventType = 'Warning'
            DependsOn = "[FSRMFileScreen]DUsersFileScreen"
        } # End of FSRMFileScreenAction Resource
    } # End of Node
} # End of Configuration

Example 2

This configuration will assign the 'Block Some Files' file screen template to the path 'D:\Users'. It will also force the File Screen assigned to this path to exactly match the 'Block Some Files' template. Any changes to the actions, include groups or active setting on the File Screen assigned to this path will cause the File Screen to be removed and reapplied.

Configuration FSRMFileScreenAction_UsingTemplate_Config
{
    Import-DscResource -Module FSRMDsc

    Node localhost
    {
        FSRMFileScreen DUsersFileScreens
        {
            Path            = 'd:\users'
            Description     = 'File Screen for Blocking Some Files'
            Ensure          = 'Present'
            Template        = 'Block Some Files'
            MatchesTemplate = $true
        } # End of FSRMFileScreen Resource
    } # End of Node
} # End of Configuration