Add-DhcpServerv4Filter

Add-DhcpServerv4Filter

Adds a MAC address filter to the Dynamic Host Configuration Protocol (DHCP) server service.

Sintaxis

Parameter Set: Add0
Add-DhcpServerv4Filter [-List] <String> [-MacAddress] <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-Description <String> ] [-Force] [-PassThru] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

The Add-DhcpServerv4Filter cmdlet adds the specified MAC address filter to the Dynamic Host Configuration Protocol (DHCP) server service. The MAC address can be added to the allow list or the deny list.

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

-ComputerName<String>

Specifies the DNS name, or IPv4 or IPv6 address, of the target computer running the DHCP server service.

Alias

Cn

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Description<String>

Specifies the description string for the MAC address filter being added.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Force

Specifies that, if one or more of the MAC addresses are already present in the allow or deny list, then the matching MAC addresses are deleted and the new entries created.

This parameter is useful in the case where the MAC address specified is already present in one list, such as the allow list, and the same MAC address now needs to be added to the other list, such as the deny list.

If this parameter is not specified, then the cmdlet will fail if the specified MAC address is already present in any of the lists.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-List<String>

Specifies the list to which one or more MAC addresses are to be added. Los valores aceptables para este parámetro son los siguientes: Allow or Deny.

Alias

ninguno

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-MacAddress<String[]>

Specifies one or more MAC addresses which are to be added to the MAC address filter list.

Alias

ClientId

¿Requerido?

true

¿Posición?

3

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-PassThru

Devuelve un objeto que representa el elemento con el que está trabajando. De forma predeterminada, este cmdlet no genera ningún resultado.

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

This example adds the specified client identified by the MAC address to the allowed list of MAC address filters.

PS C:\> Add-DhcpServerv4Filter -List Allow -MacAddress F0-DE-F1-7A-00-5E -Description "Ivan's Laptop"

Example 2

This example adds the specified clients identified by their MAC address to the allowed list of MAC address filters.

PS C:\> Add-DhcpServerv4Filter -List Allow -MacAddress F0-DE-F1-7A-00-5E, F0-DE-F1-7A-00-5C

Example 3

This example adds all of the MAC address filters in the file named MacAddressFilters.csv to the allow MAC address list of the DHCP server service running on the computer named dhcpserver.contoso.com. The Import-Csv cmdlet returns the objects with Mac address filter fields that are piped to this cmdlet, which in turn adds the MAC address filters to the server. The file named MacAddressFilters.csv should be in the following comma-separated values (CSV) format:
MacAddress,Description
1a-1b-1c-1d-1e-1f,Computer1
2a-2b-2c-2d-2e-2f,Computer2
3a-3b-3c-3d-3e-3f,Computer3

PS C:\> Import-Csv –Path MacAddressFilters.csv | Add-DhcpServerv4Filter -ComputerName dhcpserver.contoso.com -List Allow

Temas relacionados

Get-DhcpServerv4Filter

Get-DhcpServerv4FilterList

Get-DhcpServerV4Lease

Remove-DhcpServerv4Filter

Set-DhcpServerv4FilterList

Import-Csv