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 | |
---|---|---|
CustomAction | Retrieves or sets the action to execute when all the conditions are met. |
|
DaysSinceFileCreated | Retrieves or sets the number of days that have elapsed since the file was created. |
|
DaysSinceFileLastAccessed | Retrieves or sets the number of days that have elapsed since the file was last accessed. |
|
DaysSinceFileLastModified | Retrieves or sets the number of days that have elapsed since a file was last modified. |
|
Description | Gets and sets the Description property. |
|
Enabled | Retrieves or sets a value that Indicates whether the job enabled (can run). |
|
ExpirationDirectory | Retrieves or sets the root directory that will contain the expired files. |
|
FileNamePattern | Retrieves or sets a condition property: wildcard filter for names. |
|
Formats | Retrieves or sets the formats of the report to generate when the job is run. |
|
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. |
|
id | Gets the id property. |
|
LastError | Retrievers the error message from the last time the job was run. |
|
LastReportPathWithoutExtension | Retrieves the local directory path where the reports were stored the last time the job ran. |
|
LastRun | Retrieves the last time the file management job was run. |
|
Logging | Retrieves or sets the types of logging to perform. |
|
MailTo | Retrieves or sets the email addresses to which to send the reports, if any. |
|
Name | Retrieves or sets the name of the file management job. |
|
NamespaceRoots | Retrieves or sets an array of local directory paths that will be scanned when the file management job is run. |
|
Notifications | Retrieves or sets the name of the file management job. |
|
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. |
|
Parameters | Retrieves or sets the parameters for the file management job. |
|
PropertyConditions | Retrieves or sets a list of property conditions specified for the job. |
|
ReportEnabled | Retrieves or sets a value that indicates whether the job will generate a report when it runs. |
|
RunningStatus | Retrieves the running status of the job. |
|
Task | Retrieves or sets the name of the scheduled task to associate with the job. |
Methods
Name | Description | |
---|---|---|
AddNotification(Int32) | Adds a new notification value (period) to the file management job's list of notifications. |
|
Cancel() | Cancels the job if it is running. |
|
Commit() | Saves the file management job object in the server's list of objects. |
|
CreateCustomAction() | Creates a custom action object. |
|
CreateNotificationAction(Int32, _FsrmActionType) | Creates a notification action and associates it with the notification value. |
|
CreatePropertyCondition(String) | Creates a new property condition and adds it to the collection of property conditions. |
|
Delete() | Removes the file management job object from the server's list of objects. |
|
DeleteNotification(Int32) | Deletes a notification value from the file management job's list of notifications. |
|
EnumNotificationActions(Int32) | Enumerates the actions associated with a notification value. |
|
ModifyNotification(Int32, Int32) | Change a notification value in the file management job's list of notifications. |
|
Run(_FsrmReportGenerationContext) | Runs the job. |
|
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:
IFsrmFileManagementJobManager::EnumFileManagementJobs
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:
DaysSinceFileCreated
DaysSinceFileLastAccessed
DaysSinceFileLastModified
PropertyConditions (use the CreatePropertyCondition method to create the property condition)
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
Return to top