Get IPv4 DHCP Reservations in a CSV file

Copy code below and save as Get-DHCPReservations.ps1

Get-DHCPServerV4Scope | ForEach {Get-DHCPServerv4Lease -ScopeID $_.ScopeID | where {$_.AddressState -like ‘*Reservation’} | Select-Object ScopeId,IPAddress,HostName,ClientID,AddressState | Export-Csv “C:\temp\DHCPReservations.csv” -NoTypeInformation