New-FsrmQuota

New-FsrmQuota

Creates a FSRM quota.

Sintaxis

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

Descripción detallada

The New-FsrmQuota cmdlet creates a File Server Resource Manager (FSRM) quota on the server. The quota applies to the directory and all its subdirectories (recursively). Quotas that you specify on folders higher in the heirarchy further restrict the quota specified on a folder.

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

-Disabled

Indicates that the quota is disabled.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Path<String>

Specifies a valid local path to a folder.

Alias

ninguno

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

true

-Size<UInt64>

Specifies the space limit that the quota template enforces.

Alias

ninguno

¿Requerido?

false

¿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

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Template<String>

Specifies the name of a quota template on the server.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿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?

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

This command creates a quota on C:\Shares and adds a description for the quota. The quota is configured as a hard limit at 1GB in size 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 configured threshold.

PS C:\> New-FsrmQuota -Path "C:\Shares" -Description "limit usage to 1 GB." -Size 1GB

Example 2: Create a quota based on a quota template

This command creates a quota on C:\Shares based on the template named 100 MB Limit. The command specifies a description for the quota that is different from the description in the template. The quota is configured as a hard limit at 100 MB in size that does not have any thresholds.

PS C:\> New-FsrmQuota -Path "C:\Shares" –Description "limit usage to 100 MB based on template." –Template "100 MB Limit"

Example 3: Create a soft limit quota that runs a command

This example creates a new quota on C:\Shares 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 on C:\Shares 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-FsrmQuota -Path "C:\Shares" -Size 128MB -Threshold $Threshold -Softlimit

Temas relacionados

Get-FsrmQuota

Set-FsrmQuota

Update-FsrmQuota

Reset-FsrmQuota

Remove-FsrmQuota