cremenescu / isc-dhcp-to-powershell

isc-dhcp-to-powershell script to convert ubnt isc dhcp config to be imported to windows server's dhcp server through powershell
MIT License
0 stars 0 forks source link

option 119 dhcp #1

Closed cremenescu closed 4 hours ago

cremenescu commented 4 hours ago

when running the script a second time on the same server, the option 119 being defined as a global option we receive the error:

PS C:\Windows\system32> C:\Users\Administrator\Desktop\powershell-dhcp.ps1
Add-DhcpServerv4OptionDefinition : Failed to add option definition 119 on DHCP server WIN-L1IGF678TUT.
At C:\Users\Administrator\Desktop\powershell-dhcp.ps1:15 char:1
+ Add-DhcpServerv4OptionDefinition -OptionId 119 -Name 'Domain Search L ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceExists: (119:root/Microsoft/...ptionDefinition) [Add-DhcpServerv4OptionDefinition], CimException
    + FullyQualifiedErrorId : DHCP 20009,Add-DhcpServerv4OptionDefinition `
cremenescu commented 4 hours ago

updated the code.