Add-DhcpServerv4Reservation - Rafael Lab

Breaking

BANNER 728X90

2019年5月27日 星期一

Add-DhcpServerv4Reservation

Reserves an IPv4 address in the scope for a client.

Add-DhcpServerv4Reservation
   [-ComputerName <String>]
   [-ScopeId] <IPAddress>
   [-IPAddress] <IPAddress>
   [-ClientId] <String>
   [-Name <String>]
   [-Description <String>]
   [-Type <String>]
   [-PassThru]
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]



Examples

Example 1: Add a reserved IP address
This example adds a reserved IP address for the client identified by the specified client ID.
Add-DhcpServerv4Reservation -ScopeId 10.10.10.0 -IPAddress 10.10.10.8 -ClientId "F0-DE-F1-7A-00-5E" -Description "Reservation for Printer"

Example 2: Add reservations from a file
Import-Csv -Path "Reservations.csv" | Add-DhcpServerv4Reservation -ComputerName "dhcpserver.contoso.com"
 This example adds all of the reservations in the file that is named Reservations.csv to the DHCP server service that runs on the computer named dhcpserver.contoso.com. The Import-Csv cmdlet returns the objects that have reservation fields and pipes the objects to this cmdlet, which adds these reservations to the DHCP server services. The file that is named Reservations.csv should contain the reservations in the following comma-separated values (CSV) format:
ScopeId,IPAddress,Name,ClientId,Description 10.10.10.0,10.10.10.10,Computer1,1a-1b-1c-1d-1e-1f,Reserved for Computer1 20.20.20.0,20.20.20.11,Computer2,2a-2b-2c-2d-2e-2f,Reserved for Computer2 30.30.30.0,30.30.30.12,Computer3,3a-3b-3c-3d-3e-3f,Reserved for Computer3
Example 3: Convert a lease to a reservation
Get-DhcpServerv4Lease -ComputerName "dhcpserver.contoso.com" -IPAddress 10.10.10.11 | Add-DhcpServerv4Reservation -ComputerName "dhcpserver.contoso.com"
This example converts one of the leases into a reservation. The Get-DhcpServerv4Lease cmdlet returns the IP address lease object and pipes the object to this cmdlet, which creates the reservation with the IP address and client ID in the lease object.
Example 4: Create a reservation in a scope
$FreeIP = Get-DhcpServerv4FreeIPAddress -ComputerName "dhcpserver.contoso.com" -ScopeId 10.10.10.0Add-DhcpServerv4Reservation -ComputerName "dhcpserver.contoso.com" -ScopeId 10.10.10.0 -IPAddress $FreeIP -ClientId "F0-DE-F1-7A-00-5E" -Description "Reservation for Printer"
This example creates a reservation for the client identified by the specified client ID from any of the free IP addresses in the scope 10.10.10.0. The Get-DhcpServerv4FreeIPAddress cmdlet gets a free IP address in the scope, and then this cmdlet reserves an address for the specified client ID.


沒有留言:

張貼留言