Hello,
I am not sure how exactly looks like the csv that you are having prepared, but to import multiple DHCP scopes to a DHCP server. Some settings needs to be added on top level. For example DNS servers.
Required header in CSV:
name;description;startrange;endrange;subnetmask;scopeid;router
$dhcpserver = "1.1.1.1"
$scopes = Import-Csv -Path dhcp.csv -Delimiter ";"
foreach ($scope in $scopes)
{
$name = $scope.name
$description = $scope.description
Write-Output "Creating scope $name"
Add-DhcpServerv4Scope -ComputerName $dhcpserver -Name "$name" -Description "$description" -StartRange $scope.startrange -EndRange $scope.endrange -SubnetMask $scope.subnetmask -State Active -LeaseDuration 1.00:00:00
Set-DhcpServerv4OptionValue -Router $scope.router -ScopeId $scope.scopeid -ComputerName $dhcpserver
}
--If the reply is helpful, please Upvote and Accept as answer--