Die Reservierung aller Scopes exportieren:

$dhcpserver = "QuellServer.QuellDomain.com"
Get-DhcpServerv4Scope -ComputerName $dhcpserver | Get-DhcpServerv4Reservation -ComputerName $dhcpserver Export-Csv "pathtofile\ScopeReservation.csv" -Encoding UTF8 -Force -NoTypeInformation -Delimiter ";"

Als nächstes importieren wir die Reservierungen (ACHTUNG!: nicht mit Import, sondern mit Add)

$dhcpserver = "ZielServer.ZielDomain.com"
$scopes = Import-Csv -Path "pathtofile\ScopeReservation.csv" -Delimiter ";"
foreach ($scope in $scopes)
{
    $name = $scope.name
    $description = $scope.description
Write-Output "Creating scope  $name"

Add-DhcpServerv4Reservation -ComputerName $dhcpserver -ScopeId $scope.ScopeId -IPAddress $scope.IPAddress -Description $scope.description -Name $scope.name -ClientId $scope.clientid -Type $scope.Type #-WhatIf
}
Getagged mit: