New-FsrmFileManagementJob

New-FsrmFileManagementJob

Creates a file management job.

Sintaxis

Parameter Set: cim:CreateInstance0
New-FsrmFileManagementJob [-Name] <String> -Action <CimInstance> -Namespace <String[]> -Schedule <CimInstance> [-AsJob] [-CimSession <CimSession[]> ] [-Condition <CimInstance[]> ] [-Continuous] [-ContinuousLog] [-ContinuousLogSize <UInt64> ] [-Description <String> ] [-Disabled] [-MailTo <String> ] [-Notification <CimInstance[]> ] [-Parameters <String[]> ] [-ReportFormat <FmjReportFormatsEnum[]> ] [-ReportLog <FmjReportLogsEnum[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

The New-FsrmFileManagementJob cmdlet creates a file management job on the server. The job specifies a schedule, conditions, a command or actions to run if a file meets all the conditions, user notifications, and reporting.

To use this cmdlet to create a file management job, you must pass in a FsrmScheduledTask object, a FsrmFmjAction object, and a FsrmFmjNotification object.

Parámetros

-Action<CimInstance>

Specifies a FsrmFmjAction object. You can use the New-FsrmFmjAction cmdlet to create a FsrmFmjAction object.

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-AsJob

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-CimSession<CimSession[]>

Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.

Alias

Session

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Condition<CimInstance[]>

Specifies a FsrmFmjCondition object. You can use the New-FsrmFmjCondition cmdlet to create a FsrmFmjCondition object.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Continuous

Indicates that the server continuously applies classification to files in the background.

If you specify this parameter, you cannot specify any notifications and the conditions that you specify cannot include any objects where the classification property is set to the following values:
-- File.DateCreated
-- File.DateLastModified
-- File.DateLastAccessed

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ContinuousLog

Indicates that the server maintains a log of continuous classification activities. You must specify the Continuous parameter to log classification activities.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ContinuousLogSize<UInt64>

Specifies the maximum size of the log that contains continuous classification activity. You must specify the Continuous parameter to log classification activities.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Description<String>

Specifies a description for the file management job.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Disabled

Indicates that the file management job is disabled.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-MailTo<String>

Specifies a semicolon-separated list of email addresses to which the file server sends the email.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Name<String>

Specifies a name for the file management job.

Alias

ninguno

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

true

-Namespace<String[]>

Specifies an array of namespaces that are part of the scope. Each value must be either a value of the FolderType property defined on the server (in the format "[Folder type property name=<value>]") or a static path.

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Notification<CimInstance[]>

Specifies a FsrmFmjNotificationAction object. You can use the New-FsrmFmjNotificationAction cmdlet to create a FsrmFmjNotificationAction object.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Parameters<String[]>

Specifies an array of strings of the form <name>=<value>. The File Classification Infrastructure and other management tools use these parameters.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ReportFormat<FmjReportFormatsEnum[]>

Specifies an array of report formats that the file management job produces. Los valores aceptables para este parámetro son los siguientes:
-- DHTML
-- HTML
-- XML
-- CSV
-- Text

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

{"DHTML", "XML"}

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ReportLog<FmjReportLogsEnum[]>

Specifies an array of report types that the file management job generates. Los valores aceptables para este parámetro son los siguientes:
-- Information
-- Error
-- Audit

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Schedule<CimInstance>

Specifies a File Server Resource Manager (FSRM) scheduled task object that describes the schedule for performing the continuous classification. Use the New-FsrmScheduledTask cmdlet to create a scheduled task object. Any duration information in the FSRM scheduled task object is ignored.

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ThrottleLimit<Int32>

Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Confirm

Solicita confirmación antes de ejecutar el cmdlet.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-WhatIf

Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

Ejemplos

Example 1: Create a file management job that expires data

This example creates a file management job that expires all data in a namespace.

The first command gets a DateTime object and stores it in the variable $date.

PS C:\> $date = Get-Date "12:00am"

This second command returns a FsrmScheduledTask object that runs the task at midnight on the first day of the month. The command stores results in the $task variable.

PS C:\> $task = New-FsrmScheduledTask -Time $date.ToFileTimeUtc() -Monthly 1

The third command returns an action object for a management job and stores the results in the $action variable. The command specifies an expiration action and specifies a path that the action uses to expire files.

PS C:\> $action = New-FsrmFmjAction -Type Expiration -ExpirationFolder "C:\Expire"

The fourth command creates a file management job named "Expire all data" for the folder C:\Share01. The command specifies the schedule stored in the $task variable and specifies the action stored in the $action variable.

PS C:\> New-FsrmFileManagementJob -Name "Expire all data" -Namespace @("C:\Share01") -Schedule $task -Action $action

Example 2: Create a file management job that expires data continuously

This example creates a file management job that expires data in a namespace when the server runs the file management job and when a file is modified or classified.

The first command gets a DateTime object and stores it in the variable $date.

PS C:\> $date = Get-Date "12:00am"

This second command returns a FsrmScheduledTask object that runs the task at midnight on the first day of the month. The command stores results in the $task variable.

PS C:\> $task = New-FsrmScheduledTask -Time $date.ToFileTimeUtc() -Monthly 1

The third command returns an action object for a management job and stores the results in the $action variable. The command specifies an expiration action and specifies a path that the action uses to expire files.

PS C:\> $action = New-FsrmFmjAction -Type Expiration -ExpirationFolder "C:\Expire"

The fourth command creates a file management job named "Expire all data" for the folder C:\Share01. The command specifies the schedule stored in the $task variable, specifies the action stored in the $action variable, and specifies that the server continuously apply classification to files in the background.

PS C:\> New-FsrmFileManagementJob -Name "Expire all data" -Namespace @("C:\Share01") -Schedule $task -Action $action -Continuous

Example 3: Create a file management job that sends notifications

This example creates a file management job that expires data in a namespace and sends an email notice to the file owner and administrator 30 days before the server runs the file management job.

The first command gets a DateTime object and stores it in the variable $date.

PS C:\> $date = Get-Date "12:00am"

This second command returns a FsrmScheduledTask object that runs the task at midnight on the first day of the month. The command stores results in the $task variable.

PS C:\> $task = New-FsrmScheduledTask -Time $date.ToFileTimeUtc() -Monthly 1

The third command returns an action object for a management job and stores the results in the $action variable. The command specifies an expiration action and specifies a path that the action uses to expire files.

PS C:\> $action = New-FsrmFmjAction -Type Expiration -ExpirationFolder "C:\Expire"

The fourth 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. The command stores the results in the $notificationaction variable.

PS C:\> $notificationaction = 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

The fifth command returns a notification object for a file management job that runs the notification action stored in the $notificationaction variable 30 days before the file management job acts. The command stores the results in the $notification variable.

PS C:\> $notification = New-FsrmFmjNotification –Days 30 -Action $notificationaction

The sixth command creates a file management job named "Expire all data" for the folder C:\Share01. The command specifies the schedule stored in the $task variable, specifies the action stored in the $action variable, and specifies the notification stored in the $notification variable.

PS C:\> New-FsrmFileManagementJob -Name "Expire all data" -Namespace @("C:\Share01") -Schedule $task -Action $action -Notification $notification

Example 4: Create a conditional file management job

This example creates a file management job that expires all files that have the PII property set to true.

The first command gets a DateTime object and stores it in the variable $date.

PS C:\> $date = Get-Date "12:00am"

This second command returns an FsrmScheduledTask object that runs the task at midnight on the first day of the month. The command stores results in the $task variable.

PS C:\> $task = New-FsrmScheduledTask -Time $date.ToFileTimeUtc() -Monthly 1

The third command returns an action object for a management job and stores the results in the $action variable. The command specifies an expiration action and specifies a path that the action uses to expire files.

PS C:\> $action = New-FsrmFmjAction -Type Expiration -ExpirationFolder "C:\Expire"

The fourth command returns a condition object for file management job that verifies that a file has a PII classification property set to true. The command stores the results in the $condition variable.

PS C:\> $condition = New-FsrmFmjCondition -Property "PII" -Condition Equal -Value "1"

The fifth command creates a file management job named "Expire all data" for the folder C:\Share01. The command specifies the schedule stored in the $task variable, specifies the action stored in the $action variable, and specifies the condition stored in the $condition variable.

PS C:\> New-FsrmFileManagementJob -Name "Expire all data" -Namespace @("C:\Share01") -Schedule $task -Action $action -Condition $condition

Temas relacionados

Get-FsrmFileManagementJob

Set-FsrmFileManagementJob

Remove-FsrmFileManagementJob

Start-FsrmFileManagementJob

Stop-FsrmFileManagementJob

Wait-FsrmFileManagementJob

New-FsrmFmjAction

New-FsrmFmjCondition

New-FsrmScheduledTask

New-FsrmFMJNotification

New-FsrmFmjNotificationAction