New-FsrmQuotaTemplate

New-FsrmQuotaTemplate

Creates a quota template.

Sintaxis

Parameter Set: cim:CreateInstance0
New-FsrmQuotaTemplate [-Name] <String> -Size <UInt64> [-AsJob] [-CimSession <CimSession[]> ] [-Description <String> ] [-SoftLimit] [-Threshold <CimInstance[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

The New-FsrmQuotaTemplate cmdlet creates a quota template. A quota template defines a space limit, the type of quota (hard or soft), and (optionally) a set of notifications that the server generates automatically when quota usage reaches the threshold levels that you define.

Parámetros

-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

-Description<String>

Specifies a description for the quota.

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 quota.

Alias

ninguno

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

true

-Size<UInt64>

Specifies the size limit that the quota enforces.

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-SoftLimit

Indicates that the quota reports on the disk usage with respect to the size limit and run thresholds, but does not enforce the size limit.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

false

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Threshold<CimInstance[]>

Specifies an array of threshold objects.

The threshold object defines a percentage of used space from the available space that can be reached during a file operation, and a set of actions that the server takes when a quota reaches the threshold. To perform the action when the quota is exceeded, set the threshold to 100 (percent). You can use the New-FsrmQuotaThreshold cmdlet to create a threshold object.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿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 hard limit quota template

This command creates a quota template named "1GB limit". The command adds a description for the quota template and configures a hard size limit at 1GB that does not have any thresholds. A hard limit quota prevents users from saving files after the space limit is reached and generates notifications when the volume of data reaches each threshold.

PS C:\> New-FsrmQuotaTemplate -Name "1GB limit" -Description "limit usage to 1 GB." -Size 1GB

Example 2: Create a soft limit quota template that runs a command

This example creates a quota template that has a soft limit at 128MB, a threshold at 90% usage, and that runs a custom command.

The first command creates an FSRM action object and stores the results in the $Action variable. The action indicates that when an associated event occurs, the server run Cmd.exe with the specified parameters. The command specifies that server record errors codes from the executed command in the error log.

PS C:\> $Action = New-FsrmAction -Type Command -Command "c:\windows\system32\cmd.exe" -CommandParameters "echo [source file path] >> c:\log.txt" -ShouldLogError

The second command creates a threshold object and stores the results in the $Threshold variable. The command specifies the percentage of the quota limit at which to execute the action, and specifies the action stored in the $Action variable.

PS C:\> $Threshold = New-FsrmQuotaThreshold -Percentage 90 -Action $action

The third command creates a quota template named "128MB limit" and specifies the threshold stored in the $Threshold variable. The Softlimit paramater indicates the quota reports on the disk usage with respect to the size limit and run thresholds, but does not enforce the size limit.

PS C:\> New-FsrmQuotaTemplate -Name "128MB limit" -Size 128MB -Threshold $Threshold -Softlimit

Temas relacionados

Get-FsrmQuotaTemplate

Set-FsrmQuotaTemplate

Remove-FsrmQuotaTemplate