Administrators have restricted RDP access to our DHCP server.
I need to add an IP address reservation for a MAC address.
How do I remotely add an IP address reservation on the DHCP server using PowerShell?
Administrators have restricted RDP access to our DHCP server.
I need to add an IP address reservation for a MAC address.
How do I remotely add an IP address reservation on the DHCP server using PowerShell?
Use Add-DhcpServerv4Reservation:
Add-DhcpServerv4Reservation -ScopeId 10.10.10.0 -IPAddress 10.10.10.8 -ClientId "F0-DE-F1-7A-00-5E" You can also run it against a remote DHCP server using the -ComputerName parameter.
You coild also rekord powershell using invoke-command and then then commando provided earlier
$ComputerName = "DHCP_Server_Name" $ReservationParams = @{ ScopeId = "Your_DHCP_Scope_ID" IPAddress = "Reserved_IP_Address" ClientId = "MAC_Address" HostName = "Client_Host_Name" } Invoke-Command -ComputerName $ComputerName -ScriptBlock { param($ReservationParams) Add-DhcpServerv4Reservation @ReservationParams } -ArgumentList $ReservationParams Keep in mind that invoke-command is part of remote powershell and that has some requirements