Edit

Share via


New-FsrmFmjNotificationAction

Returns a notification action object for file management jobs.

Syntax

Default (Default)

New-FsrmFmjNotificationAction
    [-Type] <FmjNotificationActionTypeEnum>
    [-MailTo <String>]
    [-MailCC <String>]
    [-MailBCC <String>]
    [-Subject <String>]
    [-Body <String>]
    [-AttachmentFileListSize <UInt32>]
    [-EventType <FmjNotificationActionEventTypeEnum>]
    [-Command <String>]
    [-WorkingDirectory <String>]
    [-CommandParameters <String>]
    [-SecurityLevel <FmjNotificationActionSecurityLevelEnum>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-FsrmFmjNotificationAction cmdlet returns a notification action object that you can use to create file management job actions. You can use the FsrmFMJNotificationAction object as input for the following File Server Resource Manager (FSRM) cmdlets:

  • New-FsrmFileManagementJob
  • Set-FsrmFileManagementJob
  • New-FsrmFileScreen
  • Set-FsrmFileScreen
  • New-FsrmFileScreenTemplate
  • Set-FsrmFileScreenTemplate

The FsrmFmjAction object defines an action that the server performs when the notification period is reached. This cmdlet supports the following actions:

  • Email
  • Event
  • Command

Examples

Example 1: Create an email notification action

PS C:\> New-FsrmFmjNotificationAction -Type Email -MailTo "[Admin Email];[File Owner]" -Subject "Warning: Files will expire soon" -Body "The attached list of files will expire in 30 days." -AttachmentFileListSize 1000

This command returns a notification action object that sends the specified email message to the administrator and file owner. The command specifies that the action can attach a maximum of 1000 files to the message.

Example 2: Create an event notification action

PS C:\> New-FsrmFmjNotificationAction -Type Event -EventType Information -Body "Files will expire in 30 days."

This command returns a notification action object that logs an information event that contains the message Files will expire in 30 days. The server logs the event when an event that you associated with the action occurs.

Example 3: Create a command notification action

PS C:\> New-FsrmFmjNotificationAction -Type Command -Command "c:\windows\system32\cmd.exe" -CommandParameters "echo [source file path] >> c:\log.txt"

This command returns a notification action object that runs Cmd.exe and logs the output in a file named Log.txt. The server runs Cmd.exe when an event that you associated with the action occurs.

Parameters

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AttachmentFileListSize

Specifies the maximum number of files that the list can include.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Body

Specifies the content of an email. If you specify this parameter, you specify Email or Event for the Type parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Session

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Command

Specifies the command that the action runs. If you specify a command, you must specify Custom for the Type parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-CommandParameters

Specifies the parameters that the action passes to the command when the action runs. If you specify parameters for a command, you must specify Custom for the Type parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EventType

Specifies the event type of the action. If you specify an event type, you must specify Event for the Type parameter. The acceptable values for this parameter are:

  • None
  • Information
  • Warning
  • Error

Parameter properties

Type:FmjNotificationActionEventTypeEnum
Default value:None
Accepted values:None, Information, Warning, Error
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MailBCC

Specifies a semicolon-separated list of email addresses for the Bcc recipients of an email. Valid email addresses are an administrator email account or the owner of the file. If you specify this parameter, you must specify Email for the Type parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MailCC

Specifies a semicolon-separated list of email addresses for the Cc recipients of an email. Valid email addresses are an administrator email account or the owner of the file. If you specify this parameter, you must specify Email for the Type parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MailTo

Specifies a semicolon-separated list of email addresses for the recipients of an email. Valid email addresses are an administrator email account or the owner of the file. If you specify this parameter, you must specify Email for the Type parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SecurityLevel

Specifies the computer account type under which the executable program or script runs. The acceptable values for this parameter are:

  • LocalService
  • NetworkService
  • LocalSystem

The default value is LocalService. If you specify this parameter, you must specify Command for the Type parameter.

Parameter properties

Type:FmjNotificationActionSecurityLevelEnum
Default value:None
Accepted values:None, NetworkService, LocalService, LocalSystem
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Subject

Specifies the subject of an email. The maximum size of a subject is 1 KB. If you specify this parameter, you must specify Email for the Type parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Type

Specifies the type of notification action. The acceptable values for this parameter are:

  • Email
  • Event
  • Command

Parameter properties

Type:FmjNotificationActionTypeEnum
Default value:None
Accepted values:Event, Email, Command
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WorkingDirectory

Specifies the working directory in which the executable program or script runs. You must specify a valid path to a folder. File Server Resource Manager (FSRM) does not support paths to remote computers.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.PowerShell.Cmdletization.GeneratedTypes.FmjNotificationActionTypeEnum

String

UInt32

Microsoft.PowerShell.Cmdletization.GeneratedTypes.FmjNotificationActionEventTypeEnum

Microsoft.PowerShell.Cmdletization.GeneratedTypes.FmjNotificationActionSecurityLevelEnum

Outputs

CimInstance