共用方式為


New-FsrmFmjAction

New-FsrmFmjAction

Returns an action object for file management jobs.

Syntax

Parameter Set: CreateFmjAction0
New-FsrmFmjAction [-Type] <FmjActionTypeEnum> [-AsJob] [-CimSession <CimSession[]> ] [-Command <String> ] [-CommandParameters <String> ] [-ExpirationFolder <String> ] [-RmsFolderOwner] [-RmsFullControlUser <String[]> ] [-RmsReadUser <String[]> ] [-RmsTemplate <String> ] [-RmsWriteUser <String[]> ] [-SecurityLevel <FmjActionSecurityLevelEnum> ] [-ThrottleLimit <Int32> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The New-FsrmFmjAction cmdlet returns an object that you can use to create file management job actions. You can use the FsrmFmjAction object as input for the New-FsrmFileManagementJob cmdlet and the Set-FsrmFileManagementJob cmdlet.

The FsrmFmjAction object defines one action of the file management job when the job acts on a file. This cmdlet supports the following actions:
-- Expiration: Move the file to another location
-- RMS: Encrypt the file (Rights Management Services)
-- Custom: Run a command

Parameters

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

Session

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Command<String>

Specifies the command that the action runs. If you specify a command, you must specify Custom for the Type parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CommandParameters<String>

Specifies the parameters that the action passes to the command when the action runs. If you specify parameters for a command, you must specify Custom for the Type parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ExpirationFolder<String>

Specifies a path that the action uses to expire files. If you specify an expiration folder, you must specify Expiration for the Type parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RmsFolderOwner

Indicates that the action adds the RMS FolderOwner to the Full Control list. If a FolderOwner is not available for a file, this setting has no effect.

If you specify an RMS folder owner, you must specify RMS for the Type parameter. If you specify this parameter, do not specify the RMSFullControlUser, RMSReadUser, or RMSWriteUser parameters.

Aliases

none

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RmsFullControlUser<String[]>

Specifies an array of email addresses to provide with full control to the Active Directory Rights Management Services (AD RMS) encryption. If you specify this cmdlet, you must specify RMS for the Type parameter. If you specify this parameter, do not specify the RMSTemplate parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RmsReadUser<String[]>

Specifies an array of addresses to provide with read permission to the Active Directory Rights Management Services (AD RMS) encryption. If you specify this cmdlet, you must specify RMS for the Type parameter. If you specify this parameter, do not specify the RMSTemplate parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RmsTemplate<String>

Specifies the name of the RMS template that the actions applies to files. If you specify an RMS template, you must specify RMS for the Type parameter. If you specify this parameter, do not specify the RMSFullControlUser, RMSReadUser, or RMSWriteUser parameters.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RmsWriteUser<String[]>

Specifies an array of addresses to provide with write permission to the Active Directory Rights Management Services (AD RMS) encryption. If you specify this cmdlet, you must specify RMS for the Type parameter. If you specify this parameter, do not specify the RMSTemplate parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecurityLevel<FmjActionSecurityLevelEnum>

Specifies the system account that the action uses to run the command that you specify in the Command parameter. If you specify this parameter, you must specify Custom for the Type parameter.

Aliases

none

Required?

false

Position?

named

Default Value

LocalService

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Type<FmjActionTypeEnum>

Specifies the type of action that the file management job performs. The acceptable values for this parameter are:
-- Expiration
-- RMS
-- Custom

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-WorkingDirectory<String>

Specifies the working directory in which the program or script runs. You must specify a valid path to a folder. File Server Resource Manager (FSRM) does not support paths to remote computers. If you specify this parameter, you must specify Custom for the Type parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Management.Infrastructure.CimInstance#MSFT_FSRMFMJAction

Examples

Example 1: Create an action that expires files

This command returns an object that expires files to the path C:\shares\expire01.

PS C:\> New-FsrmFmjAction -Type Expiration -ExpirationFolder "C:\shares\expire01"

Example 2: Create an action that encrypts files by using an RMS template

This command returns an action object that encrypts a file to the Contoso Confidential RMS template. This command requires that an RMS template is configured on the RMS server named "Contoso Confidential".

PS C:\> New-FsrmFmjAction -Type RMS -RmsTemplate "Contoso Confidential"

Example 3: Create an action that encrypts files and assigns RMS permissions

This command returns an action object that encrypts a file so that the administrator account in contoso.com has full control of the file, the ALLFTE security group has edit rights to the file, and the ALLStaff group has read rights to the file.

PS C:\> New-FsrmFmjAction -Type RMS -RmsFullControlUser "admin@contoso.com" -RmsReadUser "AllStaff@contoso.com" -RmsWriteUser "AllFTE@contoso.com"

Example 4: Create an action that runs a command

This command returns an action object that runs Cmd.exe and specifies the parameters for the command.

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

New-FsrmFileManagementJob

Set-FsrmFileManagementJob