This script permits to get informations (or export) DHCP Scope informations from remote DHCP server.
It was tested on Windows DHCP server 2000 / 2003, not tested on Windows 2008.
Pre requist needed:
Get Full Windows 2000 Resource Kit , install it
Copy dhcpobjs.dll to $Env:Windir\system32\ , and register it with cmdline REGSVR32.exe $env:windir\system32\dhcpobjs.dll /s
or download dhcpobjs.zip on http://www.dynawell.com/download/reskit/microsoft/win2000/dhcpobjs.zip
extract dhcpobjs.zip , execute dhcpobjs.exe and follow instruction.
Syntax :
PS c:\MY Scripts> . .\Get-dhcpscope.ps1
PS c:\MY Scripts> Get-dhcpscope MYDHCPServer
Subnet NoOfAddressesinUse NoOffreeAddresses Comment
------ ------------------ ----------------- -------
10.19.115.0 0 103 GRAND NORD
10.248.3.16 10 4 PETIT EST
10.248.3.80 9 1 CENTRE COMMERCI ...
10.248.5.176 12 8 OUEST VENTEUX
10.248.8.128 100 0 SUD MEDITTERANE ...
10.248.12.144 0 4 MA MAISON
To export on CSV File
PS c:\MY Scripts> Get-dhcpscope MYDHCPServer | export-csv .\MyDHCPServer-AllScope.csv
To report on HTML
PS c:\MY Scripts> Get-dhcpscope MYDHCPServer | ConvertTo-HTML | Out-File .\MyDHCPServer-AllScope.HTML
Contact
If you want more info or if you want an evolution, please contact me at: sylvain . lesire AT powershell . com