- 论坛徽章:
- 0
|
不知道大家碰到和我一样的问题么??\r\n最近公司网段要重新划分,dhcp的绑定地址要重新建,2000 server没有导入工具,几百条记录啊,我真晕 \r\n赶快google,一无所获\r\n查找msdn,功夫不负有心人,终于找到解决的办法了,下载windows 2000 server resource kit,安装dhcpobjs,注册dhcpobjs.dll\r\n下面的dhcp-export.vbs代码是导出的,导入的还有点bug,以后发上来\r\n其实大家看了代码写导入的也不难了。\r\n\r\n- \r\nstrfilepath = \"dhcp.txt\"\r\nSet objFile = CreateObject(\"Scripting.FileSystemObject\")\r\nSet strguyfile=objFile.CreateTextFile(strFilePath,true)\r\nstrguyfile.WriteLine(\"******************DHCP Server Configure*************\")\r\n\r\nset dhcpmgr =Createobject(\"Dhcp.Manager\")\r\nset dhcpsrv = dhcpmgr.Servers.Connect(\"192.168.0.2\")\r\nset ll_dhcp = dhcpsrv\r\nfor i = 1 to dhcpsrv.Scopes.count\r\nstrguyfile.WriteLine(\"Scopes\"&i&\":\"&dhcpsrv.Scopes.Item(i).Address)\r\nstrguyfile.WriteLine(\"Reservations:\")\r\n for j = 1 to dhcpsrv.Scopes(i).Reservations.count \r\n ll_address = dhcpsrv.Scopes(i).Reservations(j).Address\r\n ll_name = dhcpsrv.Scopes(i).Reservations(j).name\r\n ll_uniqueid=dhcpsrv.Scopes(i).Reservations(j).UniqueID\r\n ll_comment=dhcpsrv.Scopes(i).Reservations(j).Comment\r\n strguyfile.WriteLine(chr(9)&ll_name&\",\"&ll_address&\",\"&ll_uniqueid&\",\"&ll_comment )\r\n next\r\nnext\r\nstrguyfile.WriteLine(\"****************** END *************\")\r\n
复制代码 \r\n\r\n运行,赶快看看dhcp.txt,哈哈,成功。 |
|