- 論壇徽章:
- 0
|
不知道大家碰到和我一樣的問(wèn)題么??
最近公司網(wǎng)段要重新劃分,dhcp的綁定地址要重新建,2000 server沒(méi)有導(dǎo)入工具,幾百條記錄啊,我真暈
趕快google,一無(wú)所獲
查找msdn,功夫不負(fù)有心人,終于找到解決的辦法了,下載windows 2000 server resource kit,安裝dhcpobjs,注冊(cè)dhcpobjs.dll
下面的dhcp-export.vbs代碼是導(dǎo)出的,導(dǎo)入的還有點(diǎn)bug,以后發(fā)上來(lái)
其實(shí)大家看了代碼寫導(dǎo)入的也不難了。
- strfilepath = "dhcp.txt"
- Set objFile = CreateObject("Scripting.FileSystemObject")
- Set strguyfile=objFile.CreateTextFile(strFilePath,true)
- strguyfile.WriteLine("******************DHCP Server Configure*************")
- set dhcpmgr =Createobject("Dhcp.Manager")
- set dhcpsrv = dhcpmgr.Servers.Connect("192.168.0.2")
- set ll_dhcp = dhcpsrv
- for i = 1 to dhcpsrv.Scopes.count
- strguyfile.WriteLine("Scopes"&i&":"&dhcpsrv.Scopes.Item(i).Address)
- strguyfile.WriteLine("Reservations:")
- for j = 1 to dhcpsrv.Scopes(i).Reservations.count
- ll_address = dhcpsrv.Scopes(i).Reservations(j).Address
- ll_name = dhcpsrv.Scopes(i).Reservations(j).name
- ll_uniqueid=dhcpsrv.Scopes(i).Reservations(j).UniqueID
- ll_comment=dhcpsrv.Scopes(i).Reservations(j).Comment
- strguyfile.WriteLine(chr(9)&ll_name&","&ll_address&","&ll_uniqueid&","&ll_comment )
- next
- next
- strguyfile.WriteLine("****************** END *************")
復(fù)制代碼
運(yùn)行,趕快看看dhcp.txt,哈哈,成功。 |
|