New-FsrmAction

New-FsrmAction

Returns an FSRM action object.

구문

Parameter Set: CreateAction0
New-FsrmAction [-Type] <ActionTypeEnum> [-AsJob] [-Body <String> ] [-CimSession <CimSession[]> ] [-Command <String> ] [-CommandParameters <String> ] [-EventType <ActionEventTypeEnum> ] [-KillTimeOut <Int32> ] [-MailBCC <String> ] [-MailCC <String> ] [-MailTo <String> ] [-ReportTypes <ActionReportTypeEnum[]> ] [-RunLimitInterval <Int32> ] [-SecurityLevel <ActionSecurityLevelEnum> ] [-ShouldLogError] [-Subject <String> ] [-ThrottleLimit <Int32> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The New-FsrmAction cmdlet returns a File Server Resource Manager (FSRM) action object. An FsrmAction object does not contain the trigger for the action. You can pass the action object to other cmdlets that use notifications and quota thresholds.

An FsrmAction object encapsulates a single action, such as sending an email. FSRM does not save an action object unless it is used as part of another object. For example, you can use an FsrmAction object to create notifications and quota thresholds. The saved object provides the trigger for the action.

The New-FsrmAction cmdlet supports the following actions:

-- Email: Send email to the user or administrator that the event triggered
-- Event: Create an event log entry
-- Command: Run a command that the administrator specifies
-- Report: Run one or more storage reports

매개 변수

-AsJob

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Body<String>

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

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-CimSession<CimSession[]>

원격 세션에서 또는 원격 컴퓨터에서 cmdlet을 실행합니다. New-CimSession 또는 Get-CimSession cmdlet의 출력과 같은 컴퓨터 이름이나 세션 개체를 입력합니다. 기본값은 로컬 컴퓨터의 현재 세션입니다.

별칭

Session

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Command<String>

Specifies the full path to the program or script. If you specify this parameter, you must set Command for the Type parameter.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-CommandParameters<String>

Specifies the parameters for the program or script. If you specify this parameter, you must set Command for the Type parameter.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-EventType<ActionEventTypeEnum>

Specifies the event type of the action. If you specify this parameter, you must set Event for the Type parameter. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- None
-- Information
-- Warning
-- Error

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-KillTimeOut<Int32>

Specifies the timeout period, in minutes, after which the process that the action created is ended. Specify the default, -1, to indicate that the server does not end the process. If you specify this parameter, you must set Command for the Type parameter.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

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 set Email for the Type parameter.

별칭

없음

필수 여부

false

위치

named

기본값

-1

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

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 set Email for the Type parameter.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

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 set Email for the Type parameter.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-ReportTypes<ActionReportTypeEnum[]>

Specifies an array of report types that the action generates. If you specify this parameter, you must set Report for the Type parameter. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- DuplicateFiles
-- FilesByFileGroup
-- FilesByOwner
-- FilesByProperty
-- LargeFiles
-- LeastRecentlyAccessed
-- MostRecentlyAccessed
-- QuotaUsage

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-RunLimitInterval<Int32>

Specifies the minimum interval, in minutes, before the server can run the action again. For example, if the interval expired since the action last ran, the server runs the action again in response to an event; otherwise, the server cannot run the action again. The default value, 60, specifies that there is no limit.

별칭

없음

필수 여부

false

위치

named

기본값

60

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-SecurityLevel<ActionSecurityLevelEnum>

Specifies the computer account type under which the program or script runs. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- LocalService
-- NetworkService
-- LocalSystem

별칭

없음

필수 여부

false

위치

named

기본값

LocalService

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-ShouldLogError

Indicates that the server records errors codes from running commands in the event log.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

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 set Email for the Type parameter.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-ThrottleLimit<Int32>

이 cmdlet을 실행하도록 설정할 수 있는 최대 동시 작업 수를 지정합니다. 이 매개 변수가 생략되거나 값 0이 입력되면 Windows PowerShell®은 컴퓨터에서 실행 중인 CIM cmdlet의 수에 따라 cmdlet에 대한 최적의 제한 한도를 계산합니다. 제한 한도는 현재 cmdlet에만 적용되며 세션이나 컴퓨터에는 적용되지 않습니다.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Type<ActionTypeEnum>

Specifies the type of the action. This setting determines the action that the server takes in response to a quota or file screen event. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- Email
-- Event
-- Command
-- Report

별칭

없음

필수 여부

true

위치

2

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-WorkingDirectory<String>

Specifies the working directory in which the program or script runs. You must specify a valid path to a folder. FSRM does not support paths to remote computers.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

예제

Example 1: Create an action that sends an email

This command returns an object that indicates that the server sends an email when an associated event occurs. The recipient of the email is the user sarah.jones@contosco.com and the CC recipient of the email is the administrator, john.smith@contosco.com.

PS C:\> New-FsrmAction Email -MailCC "john.smith@contosco.com" -MailTo "sarah.jones@contosco.com" -Subject "Warning: Approaching storage limit" -Body "You are about to reach the end of your available storage."

Example 2: Create an action that has a run limit

This command returns an object that indicates that the server sends an email to the administrator and the file owner when an associated event occurs. The command specifies that the event can trigger no more than once every 120 minutes. If the event does trigger, the action will have no effect before the time interval passes.

PS C:\> New-FsrmAction Email -MailTo "john.smith@contosco.com;sarah.jones@contosco.com" -Subject "Warning: Approaching storage limit" -Body "You are about to reach the end of your available storage." -RunLimitInterval 120

Example 3: Create an action that logs an event

This command returns an object that indicates the server logs an event that contains the specified message when an associated event occurs. The event should trigger no more than once every 180 minutes. If the event does trigger, no additional event log entries are created before the time interval passes.

PS C:\> New-FsrmAction Event -EventType Information -Body "The user [File Owner] is about to reach the end of his available storage." -RunLimitInterval 180

Example 4: Create an action that runs a command and logs errors

This command returns an object that indicates that when an associated event occurs, the server runs Cmd.exe with the specified parameters. The command specifies that the server records errors codes from the command in the error log.

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

Example 5: Create an action that runs a storage report

This command returns an object that indicates that the server runs LargeFiles and DuplicateFiles reports when an associated event occurs.

PS C:\> New-FsrmAction Report -ReportType @(LargeFiles, DuplicateFiles)

관련 항목

New-FsrmQuotaThreshold

New-FsrmFileScreen

New-FsrmStorageReport

New-FsrmScheduledTask

New-FsrmFileManagementJob

New-FsrmFMJNotification