New-FsrmFmjNotificationAction

New-FsrmFmjNotificationAction

Returns a notification action object for file management jobs.

Syntax

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

Detailed 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

Parameters

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AttachmentFileListSize<UInt32>

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

Aliases

none

Required?

false

Position?

named

Default Value

0

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Body<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

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

-Command<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CommandParameters<String>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-EventType<FmjNotificationActionEventTypeEnum>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MailBCC<String>

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.

Aliases

none

Required?

false

Position?

named

Default Value

-1

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MailCC<String>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MailTo<String>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecurityLevel<FmjNotificationActionSecurityLevelEnum>

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.

Aliases

none

Required?

false

Position?

named

Default Value

LocalService

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Subject<String>

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.

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

-Type<FmjNotificationActionTypeEnum>

Specifies the type of notification action. The acceptable values for this parameter are:
-- Email
-- Event
-- Command

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-WorkingDirectory<String>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

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_FSRMFMJNotificationAction

Examples

Example 1: Create an email notification action

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.

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

Example 2: Create an event notification action

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.

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

Example 3: Create a command notification action

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.

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

New-FsrmFMJNotification

New-FsrmFileManagementJob

Set-FsrmFileManagementJob

New-FsrmFileScreen

Set-FsrmFileScreen

New-FsrmFileScreenTemplate

Set-FsrmFileScreenTemplate