IFsrmFileManagementJob Interface

 

Defines a file management job. The job specifies a schedule, conditions, a command or actions to execute if a file meets all the conditions

Namespace:   Microsoft.Storage
Assembly:  srmlib (in srmlib.dll)

Syntax

[GuidAttribute("0770687E-9F36-4D6F-8778-599D188461C9")]
public interface IFsrmFileManagementJob : IFsrmObject
[GuidAttribute("0770687E-9F36-4D6F-8778-599D188461C9")]
public interface class IFsrmFileManagementJob : IFsrmObject
[<GuidAttribute("0770687E-9F36-4D6F-8778-599D188461C9")>]
type IFsrmFileManagementJob = 
    interface
        interface IFsrmObject
    end
<GuidAttribute("0770687E-9F36-4D6F-8778-599D188461C9")>
Public Interface IFsrmFileManagementJob
    Inherits IFsrmObject

Properties

Name Description
System_CAPS_pubproperty CustomAction

Retrieves or sets the action to execute when all the conditions are met.

System_CAPS_pubproperty DaysSinceFileCreated

Retrieves or sets the number of days that have elapsed since the file was created.

System_CAPS_pubproperty DaysSinceFileLastAccessed

Retrieves or sets the number of days that have elapsed since the file was last accessed.

System_CAPS_pubproperty DaysSinceFileLastModified

Retrieves or sets the number of days that have elapsed since a file was last modified.

System_CAPS_pubproperty Description

Gets and sets the Description property.

System_CAPS_pubproperty Enabled

Retrieves or sets a value that Indicates whether the job enabled (can run).

System_CAPS_pubproperty ExpirationDirectory

Retrieves or sets the root directory that will contain the expired files.

System_CAPS_pubproperty FileNamePattern

Retrieves or sets a condition property: wildcard filter for names.

System_CAPS_pubproperty Formats

Retrieves or sets the formats of the report to generate when the job is run.

System_CAPS_pubproperty FromDate

Retrieves or sets the date from which you want the file management job to begin expiring files (moving files to the expired files directory). This property also applies to custom commands for the file management job.

System_CAPS_pubproperty id

Gets the id property.

System_CAPS_pubproperty LastError

Retrievers the error message from the last time the job was run.

System_CAPS_pubproperty LastReportPathWithoutExtension

Retrieves the local directory path where the reports were stored the last time the job ran.

System_CAPS_pubproperty LastRun

Retrieves the last time the file management job was run.

System_CAPS_pubproperty Logging

Retrieves or sets the types of logging to perform.

System_CAPS_pubproperty MailTo

Retrieves or sets the email addresses to which to send the reports, if any.

System_CAPS_pubproperty Name

Retrieves or sets the name of the file management job.

System_CAPS_pubproperty NamespaceRoots

Retrieves or sets an array of local directory paths that will be scanned when the file management job is run.

System_CAPS_pubproperty Notifications

Retrieves or sets the name of the file management job.

System_CAPS_pubproperty OperationType

Retrieves or sets the type of file management job. The type determines the operation to perform on a file when all conditions are met.

System_CAPS_pubproperty Parameters

Retrieves or sets the parameters for the file management job.

System_CAPS_pubproperty PropertyConditions

Retrieves or sets a list of property conditions specified for the job.

System_CAPS_pubproperty ReportEnabled

Retrieves or sets a value that indicates whether the job will generate a report when it runs.

System_CAPS_pubproperty RunningStatus

Retrieves the running status of the job.

System_CAPS_pubproperty Task

Retrieves or sets the name of the scheduled task to associate with the job.

Methods

Name Description
System_CAPS_pubmethod AddNotification(Int32)

Adds a new notification value (period) to the file management job's list of notifications.

System_CAPS_pubmethod Cancel()

Cancels the job if it is running.

System_CAPS_pubmethod Commit()

Saves the file management job object in the server's list of objects.

System_CAPS_pubmethod CreateCustomAction()

Creates a custom action object.

System_CAPS_pubmethod CreateNotificationAction(Int32, _FsrmActionType)

Creates a notification action and associates it with the notification value.

System_CAPS_pubmethod CreatePropertyCondition(String)

Creates a new property condition and adds it to the collection of property conditions.

System_CAPS_pubmethod Delete()

Removes the file management job object from the server's list of objects.

System_CAPS_pubmethod DeleteNotification(Int32)

Deletes a notification value from the file management job's list of notifications.

System_CAPS_pubmethod EnumNotificationActions(Int32)

Enumerates the actions associated with a notification value.

System_CAPS_pubmethod ModifyNotification(Int32, Int32)

Change a notification value in the file management job's list of notifications.

System_CAPS_pubmethod Run(_FsrmReportGenerationContext)

Runs the job.

System_CAPS_pubmethod WaitForCompletion(Int32)

Waits for the specified period of time or until the job has finished running.

Remarks

To create a file management job, call the IFsrmFileManagementJobManager::CreateFileManagementJob method.

The following methods return this interface:

  1. IFsrmFileManagementJobManager::EnumFileManagementJobs

  2. IFsrmFileManagementJobManager::GetFileManagementJob

If a file management job object is modified using MSFT_FSRMFileManagementJob or a related WMI class, then the methods and properties of the IFsrmFileManagementJob interface may no longer be usable and fail in unexpected ways when working with the same job.

When a file management job runs, it scans the files in the specified folders and if a file in the folder meets the conditions specified by the job, FSRM moves the file to the specified expired files folder if the type is expiration, or runs the custom action if defined. If notifications or actions are specified, FSRM sends the notifications and performs the actions.

Use the following properties to specify the expiration conditions:

  1. DaysSinceFileCreated

  2. DaysSinceFileLastAccessed

  3. DaysSinceFileLastModified

  4. PropertyConditions (use the CreatePropertyCondition method to create the property condition)

  5. FSRM performs a logical AND on all the conditions to determine if the file meets those conditions.

FSRM does not expire files in the system directories (for example, "\Windows", "\System Volume Information", "$Event", and "$Recycle").

See Also

Microsoft.Storage Namespace

Return to top