Freigeben über


CreateAction method of the MSFT_FSRMAction class

Creates a new MSFT_FSRMAction instance.

Syntax

uint64 CreateAction(
  [in]  uint32          Type,
  [in]  string          MailTo,
  [in]  string          MailCC,
  [in]  string          MailBCC,
  [in]  string          Subject,
  [in]  string          Body,
  [in]  uint32          EventType,
  [in]  string          Command,
  [in]  string          WorkingDirectory,
  [in]  string          CommandParameters,
  [in]  uint32          SecurityLevel = LocalService,
  [in]  sint32          KillTimeOut,
  [in]  boolean         ShouldLogError,
  [in]  uint32          ReportTypes[],
  [in]  sint32          RunLimitInterval,
  [out] MSFT_FSRMAction Action
);

Parameters

Type [in]

The type of the action, which determines the action that is taken in response to a quota or file screen event. See the FsrmActionType enumeration.

Event (1)

The Action is an event logged to the Application event log.

Email (2)

The Action is an email.

Command (3)

The Action is to run a command or script.

Report (4)

The Action is to generate a report.

MailTo [in]

A semicolon-separated list of email addresses that are to be on the to line of the mail. This parameter is used if the Type parameter is 2 (Email) or 4 (Report.)

MailCC [in]

A semicolon-separated list of email addresses that are to be on the to line of the mail. This parameter is used if the Type parameter is 2 (Email.)

MailBCC [in]

A semicolon-separated list of email addresses that are to be on the to line of the mail. This parameter is used if the Type parameter is 2 (Email.)

Subject [in]

The subject of the email. This parameter is used if the Type parameter is 2 (Email) and is limited to 1 KB.

Body [in]

The content of the event or email. This parameter is used if the Type parameter is 1 (Event) or 2 (Email) and is limited to 10 KB.

EventType [in]

The event type of the action. This parameter is used if the Type parameter is 1 (Event.) See the FsrmEventType enumeration.

None (0)

The event type is unknown.

Information (1)

The event type is informational.

Warning (2)

The event type is a warning.

Error (3)

The event type is an error.

Command [in]

The full path to the executable program or script to run. This parameter is used if the Type parameter is 3 (Command.) See the ExecutablePath property of IFsrmActionCommand.

WorkingDirectory [in]

The working directory in which the executable program or script will run. This parameter is used if the Type parameter is 3 (Command.) See the WorkingDirectory property of IFsrmActionCommand.

CommandParameters [in]

The parameters for the executable program or script to be run. This parameter is used if the Type parameter is 3 (Command.) See the Arguments property of IFsrmActionCommand.

SecurityLevel [in]

The account under which the executable program or script will be run. This parameter is used if the Type parameter is 3 (Command.) See the FsrmAccountType enumeration.

None (0)

No account is specified.

NetworkService (1)

The command will be run by the "NetworkService" account.

LocalService (2)

The command will be run by the "LocalService" account.

LocalSystem (3)

The command will be run by the "LocalSystem" account.

KillTimeOut [in]

The timeout period, in minutes, after which the process created by the action will be terminated, or -1 (0xffffffff, the default value) if the process is not to be terminated. This parameter is used if the Type parameter is 3 (Command.) See the KillTimeOut property of IFsrmActionCommand.

ShouldLogError [in]

If true, error codes from executed commands are logged in the event log. This parameter is used if the Type parameter is 3 (Command. See the LogResult property of IFsrmActionCommand.

ReportTypes [in]

Specifies the type of the report to be generated by this action. This parameter is used if the Type parameter is 4 (Report.) See the FsrmReportType enumeration type.

LargeFiles (1)

A report is generated for any files that match the ReportLargeFileMinimum and ReportLargeFilePattern properties of the MSFT_FSRMSettings class.

FilesByFileGroup (2)

Lists groups of files. Create file groups using the MSFT_FSRMFileGroup class and put the names of the groups in the ReportFileGroupsIncluded property of the MSFT_FSRMSettings class. The ReportLimitMaxFilesPerFileGroup and ReportLimitMaxFileGroup properties of the MSFT_FSRMSettings class can be used to limit the report.

LeastRecentlyAccessed (3)

A report is generated for any files that matches the ReportLeastAccessedMinimum and ReportLeastAccessedFilePattern properties of the MSFT_FSRMSettings class.

MostRecentlyAccessed (4)

A report is generated for any files that matches the pattern in the ReportMostAccessedMaximum and ReportMostAccessedFilePattern properties of the MSFT_FSRMSettings class.

QuotaUsage (5)

A report is generated for any files that matches the ReportQuotaMinimumUsage properties of the MSFT_FSRMSettings class, up to the limit specified by the ReportLimitMaxQuota property of the MSFT_FSRMSettings class.

FilesByOwner (6)

A report is generated for any files that matches the ReportFileOwnerUser and ReportFileOwnerFilePattern properties of the MSFT_FSRMSettings class up to the limits specified by the ReportLimitMaxOwner and ReportLimitMaxFilesPerOwner properties of the MSFT_FSRMSettings class.

DuplicateFiles (8)

Lists duplicate files. All files with the same file name, file size, and last modify time under the scope of the report job are considered duplicates. For example, if the scope of the report is C:\ and D:\ and file file1.txt exists in C:\folder1\, C:\folder2\ and D:\folder1\ with the same modify time and file size, then the files are considered duplicates.

FileScreenAuditFiles (9)

Lists file screening events that have occurred for any files that match the ReportFileScreenAuditDaysSince, ReportFileScreenAuditUser, and ReportFileScreenAuditEnable properties of the MSFT_FSRMSettings class, up to the limit specified by the ReportLimitMaxFileScreenEvent property of the MSFT_FSRMSettings class.

FilesByProperty (10)

Lists files, grouped by property value, that matches the ReportPropertyName and ReportPropertyFilePattern properties of the MSFT_FSRMSettings class up to the limits specified by the ReportLimitMaxPropertyValue and ReportLimitMaxFilesPerPropertyValue properties of the MSFT_FSRMSettings class.

RunLimitInterval [in]

Specifies the minimum number of minutes between runs of the action. 0xffffffff specifies that there is no limit.

Action [out]

Receives a MSFT_FSRMAction instance upon successful completion.

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2012
Namespace
Root\Microsoft\Windows\FSRM
Header
Fsrmscreen.h
MOF
MSFT_FSRM.mof
DLL
SrmSvc.dll

See also

MSFT_FSRMAction