Настраиваем DHCP сервер с помощью NetSh сценария
Как и обещал, приведу пример сценария netSh для конфигурирования DHCP сервера (серверов).
Для начала – сам сценарий:
pushd offline dhcp server \\server.domain.ru set dnsconfig 1 0 0 1 Add Class "Default BOOTP Class" "User class for BOOTP Clients" 424f4f54502e4d6963726f736f6674 0 b Add Class "Default Routing and Remote Access Class" "User class for remote access clients" 525241532e4d6963726f736f6674 0 b Add Class "Microsoft Windows 2000 Options" "Microsoft vendor-specific options for Windows 2000 Clients" 4d53465420352e30 1 b Add Optiondef 1 "Subnet Mask" IPADDRESS 0 comment="Subnet mask in network byte order" 0.0.0.0 delete optionvalue 1 Add Optiondef 2 "Time Offset" DWORD 0 comment="UCT offset in seconds" 0 delete optionvalue 2 Add Optiondef 3 "Router" IPADDRESS 1 comment="Array of router addresses ordered by preference" 0.0.0.0 delete optionvalue 3 Add Optiondef 4 "Time Server" IPADDRESS 1 comment="Array of time server addresses, by preference" 0.0.0.0 delete optionvalue 4 Add Optiondef 5 "Name Servers" IPADDRESS 1 comment="Array of name servers [IEN 116], by preference" 0.0.0.0 delete optionvalue 5 Add Optiondef 6 "DNS Servers" IPADDRESS 1 comment="Array of DNS servers, by preference" 0.0.0.0 delete optionvalue 6 Add Optiondef 7 "Log Servers" IPADDRESS 1 comment="Array of MIT_LCS UDP log servers on subnet" 0.0.0.0 delete optionvalue 7 Add Optiondef 8 "Cookie Servers" IPADDRESS 1 comment="Array of cookie servers, RFC 865" 0.0.0.0 delete optionvalue 8 Add Optiondef 9 "LPR Servers" IPADDRESS 1 comment="Array of RFC 1179 servers, by preference" 0.0.0.0 delete optionvalue 9 Add Optiondef 10 "Impress Servers" IPADDRESS 1 comment="Array of Imagen Impress Servers" 0.0.0.0 delete optionvalue 10 Add Optiondef 11 "Resource Location Servers" IPADDRESS 1 comment="Array of RFC 887 ResLoc Servers on subnet, by preference" 0.0.0.0 delete optionvalue 11 Add Optiondef 12 "Host Name" STRING 0 comment="Host name for client, RFC 1035 character set" "" delete optionvalue 12 Add Optiondef 13 "Boot File Size" WORD 0 comment="Size of boot image file in 512-octet blocks" 0 delete optionvalue 13 Add Optiondef 14 "Merit Dump File" STRING 0 comment="Path name for crash dump file" "" delete optionvalue 14 Add Optiondef 15 "DNS Domain Name" STRING 0 comment="DNS Domain name for client resolutions" "" delete optionvalue 15 set optionvalue 15 STRING "novgaro.ru" Add Optiondef 16 "Swap Server" IPADDRESS 0 comment="Address of client's swap server" 0.0.0.0 delete optionvalue 16 Add Optiondef 17 "Root Path" STRING 0 comment="Path name for client's root disk, char set NVT ASCII" "" delete optionvalue 17 Add Optiondef 18 "Extensions Path" STRING 0 comment="tftp file for option extensions" "" delete optionvalue 18 Add Optiondef 19 "IP Layer Forwarding" BYTE 0 comment="Disable/enable IP packet forwarding on this client" 0 delete optionvalue 19 set optionvalue 19 BYTE "1" Add Optiondef 20 "Nonlocal Source Routing" BYTE 0 comment="Disable/enable nonlocal datagrams" 0 delete optionvalue 20 set optionvalue 20 BYTE "0" Add Optiondef 21 "Policy Filter Masks" IPADDRESS 1 comment="Destination/mask IP address pairs to filter source routes" 0.0.0.0 delete optionvalue 21 Add Optiondef 22 "Max DG Reassembly Size" WORD 0 comment="Maximum size datagram for reassembly by client; max 576" 0 delete optionvalue 22 Add Optiondef 23 "Default IP Time-to-live" BYTE 0 comment="Default TTL for client's use on outgoing DGs" 0 delete optionvalue 23 Add Optiondef 24 "Path MTU Aging Timeout" DWORD 0 comment="Timeout in seconds for aging Path MTU values; RFC 1191" 0 delete optionvalue 24 Add Optiondef 25 "Path MTU Plateau Table" WORD 1 comment="MTU discovery sizes, sorted by size, all >= 68" 0 delete optionvalue 25 Add Optiondef 26 "MTU Option" WORD 0 comment="MTU discovery size, >= 68" 0 delete optionvalue 26 Add Optiondef 27 "All subnets are local" BYTE 0 comment="The client assumes that all subnets are local" 0 delete optionvalue 27 Add Optiondef 28 "Broadcast Address" IPADDRESS 0 comment="Broadcast address" 0.0.0.0 delete optionvalue 28 Add Optiondef 29 "Perform Mask Discovery" BYTE 0 comment="The client should use ICMP for subnet mask discovery." 0 delete optionvalue 29 Add Optiondef 30 "Mask Supplier Option" BYTE 0 comment="The client should respond to subnet mask requests via ICMP." 0 delete optionvalue 30 Add Optiondef 31 "Perform Router Discovery" BYTE 0 comment="The client should solicit routers using RFC 1256." 0 delete optionvalue 31 Add Optiondef 32 "Router Solicitation Address" IPADDRESS 0 comment="Address to use for router solicitation" 0.0.0.0 delete optionvalue 32 Add Optiondef 33 "Static Route Option" IPADDRESS 1 comment="Destination/router address pairs, in priority order" 0.0.0.0 delete optionvalue 33 Add Optiondef 34 "Trailer Encapsulation" BYTE 0 comment="The client should negotiate use of trailers (RFC 983)." 0 delete optionvalue 34 Add Optiondef 35 "ARP Cache Timeout" DWORD 0 comment="Timeout in seconds for ARP cache entries" 0 delete optionvalue 35 set optionvalue 35 DWORD "86400" Add Optiondef 36 "Ethernet Encapsulation" BYTE 0 comment="0=>client should use ENet V2; 1=> IEEE 802.3" 0 delete optionvalue 36 set optionvalue 36 BYTE "1" Add Optiondef 37 "TCP Default Time-to-live" BYTE 0 comment="TTL that client uses when sending TCP segments" 0 delete optionvalue 37 Add Optiondef 38 "Keepalive Interval" DWORD 0 comment="Keepalive timeout in seconds" 0 delete optionvalue 38 Add Optiondef 39 "Keepalive Garbage" BYTE 0 comment="Send garbage octet" 0 delete optionvalue 39 Add Optiondef 40 "NIS Domain Name" STRING 0 comment="Name of Network Information Service domain" "" delete optionvalue 40 Add Optiondef 41 "NIS Servers" IPADDRESS 1 comment="Addresses of NIS servers on client's subnet" 0.0.0.0 delete optionvalue 41 Add Optiondef 42 "NTP Servers" IPADDRESS 1 comment="Addresses of Network Time Protocol servers" 0.0.0.0 delete optionvalue 42 set optionvalue 42 IPADDRESS "172.31.0.22" Add Optiondef 43 "Vendor Specific Info" BINARY 0 comment="Embedded vendor-specific options" 00 delete optionvalue 43 Add Optiondef 44 "WINS/NBNS Servers" IPADDRESS 1 comment="NBNS Address(es) in priority order" 0.0.0.0 delete optionvalue 44 Add Optiondef 45 "NetBIOS over TCP/IP NBDD" IPADDRESS 1 comment="NetBIOS over TCP/IP NBDD address(es) in priority order" 0.0.0.0 delete optionvalue 45 Add Optiondef 46 "WINS/NBT Node Type" BYTE 0 comment="0x1 = B-node, 0x2 = P-node, 0x4 = M-node, 0x8 = H-node" 0 delete optionvalue 46 set optionvalue 46 BYTE "2" Add Optiondef 47 "NetBIOS Scope ID" STRING 0 comment="NetBIOS over TCP/IP Scope ID" "" delete optionvalue 47 Add Optiondef 48 "X Window System Font" IPADDRESS 1 comment="Array of X Windows font servers" 0.0.0.0 delete optionvalue 48 Add Optiondef 49 "X Window System Display" IPADDRESS 1 comment="Array of X Windows Display Mgr servers" 0.0.0.0 delete optionvalue 49 Add Optiondef 51 "Lease" DWORD 0 comment="Client IP address lease time in seconds" 0 #delete optionvalue 51 Add Optiondef 58 "Renewal (T1) Time Value" DWORD 0 comment="Time between addr assignment to RENEWING state" 0 #delete optionvalue 58 Add Optiondef 59 "Rebinding (T2) Time Value" DWORD 0 comment="Time from addr assignment to REBINDING state" 0 #delete optionvalue 59 Add Optiondef 60 "ClassID" STRING 0 comment="Client type for RIS servers" "PXEClient" delete optionvalue 60 #set optionvalue 60 STRING "PXEClient" Add Optiondef 64 "NIS+ Domain Name" STRING 0 comment="The name of the client's NIS+ domain." "" delete optionvalue 64 Add Optiondef 65 "NIS+ Servers" IPADDRESS 1 comment="A list of IP addresses indicating NIS+ servers" 0.0.0.0 delete optionvalue 65 Add Optiondef 66 "Boot Server Host Name" STRING 0 comment="TFTP boot server host name" "" delete optionvalue 66 #set optionvalue 66 STRING "ris.services.novgaro.ru" Add Optiondef 67 "Bootfile Name" STRING 0 comment="Bootfile Name" "" delete optionvalue 67 #set optionvalue 67 STRING "startrom.com" Add Optiondef 68 "Mobile IP Home Agents" IPADDRESS 1 comment="Mobile IP home agents in priority order" 0.0.0.0 delete optionvalue 68 Add Optiondef 69 "Simple Mail Transport Protocol (SMTP) Servers" IPADDRESS 1 comment="List of SMTP servers available to the client" 0.0.0.0 delete optionvalue 69 set optionvalue 69 IPADDRESS "172.31.0.12" Add Optiondef 70 "Post Office Protocol (POP3) Servers" IPADDRESS 1 comment="List of POP3 servers available to the client" 0.0.0.0 delete optionvalue 70 set optionvalue 70 IPADDRESS "172.31.0.12" Add Optiondef 71 "Network News Transport Protocol (NNTP) Servers" IPADDRESS 1 comment="List of NNTP servers available to the client" 0.0.0.0 delete optionvalue 71 Add Optiondef 72 "World Wide Web (WWW) Servers" IPADDRESS 1 comment="List of WWW servers available to the client" 0.0.0.0 delete optionvalue 72 Add Optiondef 73 "Finger Servers" IPADDRESS 1 comment="List of Finger servers available to the client" 0.0.0.0 delete optionvalue 73 Add Optiondef 74 "Internet Relay Chat (IRC) Servers" IPADDRESS 1 comment="List of IRC servers available to the client" 0.0.0.0 delete optionvalue 74 Add Optiondef 75 "StreetTalk Servers" IPADDRESS 1 comment="List of StreetTalk servers available to the client" 0.0.0.0 delete optionvalue 75 Add Optiondef 76 "StreetTalk Directory Assistance (STDA) Servers" IPADDRESS 1 comment="List of STDA servers available to the client" 0.0.0.0 delete optionvalue 76 Add Optiondef 252 "WPAD" STRING 0 comment="Расположение порта ISA сервера с функцией autodiscovery" "http://proxy.inet.services.novgaro.ru:80/wpad.dat" delete optionvalue 252 set optionvalue 252 STRING "http://proxy.inet.services.novgaro.ru:8081/wpad.dat" Add Optiondef 1 "Microsoft Disable Netbios Option " DWORD 0 vendor="Microsoft Options" comment="Option for enabling or disabling Netbios for Microsoft Windows 2000 Clients" 1 delete optionvalue 1 vendor="Microsoft Options" set optionvalue 1 vendor="Microsoft Options" DWORD "1" Add Optiondef 1 "Microsoft Disable Netbios Option " DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Option for enabling or disabling Netbios for Microsoft Windows 2000 Clients" 1 delete optionvalue 1 vendor="Microsoft Windows 2000 Options" delete optionvalue 1 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" delete optionvalue 1 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" set optionvalue 1 vendor="Microsoft Windows 2000 Options" DWORD "1" set optionvalue 1 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" DWORD "1" set optionvalue 1 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" DWORD "1" Add Optiondef 2 "Microsoft Release DHCP Lease On Shutdown Option" DWORD 0 vendor="Microsoft Options" comment="Option for enabling or disabling Windows 2000 Clients to release DHCP lease on shutdown" 0 delete optionvalue 2 vendor="Microsoft Options" set optionvalue 2 vendor="Microsoft Options" DWORD "0" Add Optiondef 2 "Microsoft Release DHCP Lease On Shutdown Option" DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Option for enabling or disabling Windows 2000 Clients to release DHCP lease on shutdown" 0 delete optionvalue 2 vendor="Microsoft Windows 2000 Options" delete optionvalue 2 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" delete optionvalue 2 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" set optionvalue 2 vendor="Microsoft Windows 2000 Options" DWORD "1" set optionvalue 2 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" DWORD "1" set optionvalue 2 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" DWORD "1" Add Optiondef 3 "Microsoft Default Router Metric Base" DWORD 0 vendor="Microsoft Options" comment="Default Router Base Metrics for Microsoft Windows 2000 Clients" 0 delete optionvalue 3 vendor="Microsoft Options" set optionvalue 2 vendor="Microsoft Options" DWORD "1" Add Optiondef 3 "Microsoft Default Router Metric Base" DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Default Router Base Metrics for Microsoft Windows 2000 Clients" 0 delete optionvalue 3 vendor="Microsoft Windows 2000 Options" delete optionvalue 3 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" delete optionvalue 3 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" set optionvalue 3 vendor="Microsoft Windows 2000 Options" DWORD "1" set optionvalue 3 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" DWORD "1" set optionvalue 3 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" DWORD "1" add scope 172.31.0.0 255.255.0.0 "local-net" "local main subnet" scope 172.31.0.0 set state 1 add iprange 172.31.0.1 172.31.255.254 add excluderange 172.31.0.1 172.31.0.255 add excluderange 172.31.1.0 172.31.1.255 add excluderange 172.31.2.0 172.31.2.255 add excluderange 172.31.30.0 172.31.30.255 #Add Optiondef 1 "Subnet Mask" IPADDRESS 0 comment="Subnet mask in network byte order" 0.0.0.0 delete optionvalue 1 #Add Optiondef 2 "Time Offset" DWORD 0 comment="UCT offset in seconds" 0 delete optionvalue 2 #Add Optiondef 3 "Router" IPADDRESS 1 comment="Array of router addresses ordered by preference" 0.0.0.0 delete optionvalue 3 set optionvalue 3 IPADDRESS "172.31.0.9" #Add Optiondef 4 "Time Server" IPADDRESS 1 comment="Array of time server addresses, by preference" 0.0.0.0 delete optionvalue 4 #Add Optiondef 5 "Name Servers" IPADDRESS 1 comment="Array of name servers [IEN 116], by preference" 0.0.0.0 delete optionvalue 5 #Add Optiondef 6 "DNS Servers" IPADDRESS 1 comment="Array of DNS servers, by preference" 0.0.0.0 delete optionvalue 6 set optionvalue 6 IPADDRESS "172.31.0.22" "172.31.0.6" #Add Optiondef 7 "Log Servers" IPADDRESS 1 comment="Array of MIT_LCS UDP log servers on subnet" 0.0.0.0 delete optionvalue 7 #Add Optiondef 8 "Cookie Servers" IPADDRESS 1 comment="Array of cookie servers, RFC 865" 0.0.0.0 delete optionvalue 8 #Add Optiondef 9 "LPR Servers" IPADDRESS 1 comment="Array of RFC 1179 servers, by preference" 0.0.0.0 delete optionvalue 9 #Add Optiondef 10 "Impress Servers" IPADDRESS 1 comment="Array of Imagen Impress Servers" 0.0.0.0 delete optionvalue 10 #Add Optiondef 11 "Resource Location Servers" IPADDRESS 1 comment="Array of RFC 887 ResLoc Servers on subnet, by preference" 0.0.0.0 delete optionvalue 11 #Add Optiondef 12 "Host Name" STRING 0 comment="Host name for client, RFC 1035 character set" "" delete optionvalue 12 #Add Optiondef 13 "Boot File Size" WORD 0 comment="Size of boot image file in 512-octet blocks" 0 delete optionvalue 13 #Add Optiondef 14 "Merit Dump File" STRING 0 comment="Path name for crash dump file" "" delete optionvalue 14 #Add Optiondef 15 "DNS Domain Name" STRING 0 comment="DNS Domain name for client resolutions" "" delete optionvalue 15 #Add Optiondef 16 "Swap Server" IP#AddRESS 0 comment="#Address of client's swap server" 0.0.0.0 delete optionvalue 16 #Add Optiondef 17 "Root Path" STRING 0 comment="Path name for client's root disk, char set NVT ASCII" "" delete optionvalue 17 #Add Optiondef 18 "Extensions Path" STRING 0 comment="tftp file for option extensions" "" delete optionvalue 18 #Add Optiondef 19 "IP Layer Forwarding" BYTE 0 comment="Disable/enable IP packet forwarding on this client" 0 delete optionvalue 19 set optionvalue 19 BYTE "0" #Add Optiondef 20 "Nonlocal Source Routing" BYTE 0 comment="Disable/enable nonlocal datagrams" 0 delete optionvalue 20 set optionvalue 20 BYTE "0" #Add Optiondef 21 "Policy Filter Masks" IP#AddRESS 1 comment="Destination/mask IP #Address pairs to filter source routes" 0.0.0.0 delete optionvalue 21 #Add Optiondef 22 "Max DG Reassembly Size" WORD 0 comment="Maximum size datagram for reassembly by client; max 576" 0 delete optionvalue 22 #Add Optiondef 23 "Default IP Time-to-live" BYTE 0 comment="Default TTL for client's use on outgoing DGs" 0 delete optionvalue 23 #Add Optiondef 24 "Path MTU Aging Timeout" DWORD 0 comment="Timeout in seconds for aging Path MTU values; RFC 1191" 0 delete optionvalue 24 #Add Optiondef 25 "Path MTU Plateau Table" WORD 1 comment="MTU discovery sizes, sorted by size, all >= 68" 0 delete optionvalue 25 #Add Optiondef 26 "MTU Option" WORD 0 comment="MTU discovery size, >= 68" 0 delete optionvalue 26 #Add Optiondef 27 "All subnets are local" BYTE 0 comment="The client assumes that all subnets are local" 0 delete optionvalue 27 #Add Optiondef 28 "Broadcast #Address" IP#AddRESS 0 comment="Broadcast #Address" 0.0.0.0 delete optionvalue 28 #Add Optiondef 29 "Perform Mask Discovery" BYTE 0 comment="The client should use ICMP for subnet mask discovery." 0 delete optionvalue 29 #Add Optiondef 30 "Mask Supplier Option" BYTE 0 comment="The client should respond to subnet mask requests via ICMP." 0 delete optionvalue 30 #Add Optiondef 31 "Perform Router Discovery" BYTE 0 comment="The client should solicit routers using RFC 1256." 0 delete optionvalue 31 #Add Optiondef 32 "Router Solicitation #Address" IP#AddRESS 0 comment="#Address to use for router solicitation" 0.0.0.0 delete optionvalue 32 #Add Optiondef 33 "Static Route Option" IP#AddRESS 1 comment="Destination/router #Address pairs, in priority order" 0.0.0.0 delete optionvalue 33 #Add Optiondef 34 "Trailer Encapsulation" BYTE 0 comment="The client should negotiate use of trailers (RFC 983)." 0 delete optionvalue 34 #Add Optiondef 35 "ARP Cache Timeout" DWORD 0 comment="Timeout in seconds for ARP cache entries" 0 delete optionvalue 35 #Add Optiondef 36 "Ethernet Encapsulation" BYTE 0 comment="0=>client should use ENet V2; 1=> IEEE 802.3" 0 delete optionvalue 36 #Add Optiondef 37 "TCP Default Time-to-live" BYTE 0 comment="TTL that client uses when sending TCP segments" 0 delete optionvalue 37 #Add Optiondef 38 "Keepalive Interval" DWORD 0 comment="Keepalive timeout in seconds" 0 delete optionvalue 38 #Add Optiondef 39 "Keepalive Garbage" BYTE 0 comment="Send garbage octet" 0 delete optionvalue 39 #Add Optiondef 40 "NIS Domain Name" STRING 0 comment="Name of Network Information Service domain" "" delete optionvalue 40 #Add Optiondef 41 "NIS Servers" IP#AddRESS 1 comment="#Addresses of NIS servers on client's subnet" 0.0.0.0 delete optionvalue 41 #Add Optiondef 42 "NTP Servers" IP#AddRESS 1 comment="#Addresses of Network Time Protocol servers" 0.0.0.0 delete optionvalue 42 #Add Optiondef 43 "Vendor Specific Info" BINARY 0 comment="Embedded vendor-specific options" 00 delete optionvalue 43 #Add Optiondef 44 "WINS/NBNS Servers" IP#AddRESS 1 comment="NBNS #Address(es) in priority order" 0.0.0.0 delete optionvalue 44 #Add Optiondef 45 "NetBIOS over TCP/IP NBDD" IP#AddRESS 1 comment="NetBIOS over TCP/IP NBDD #Address(es) in priority order" 0.0.0.0 delete optionvalue 45 #Add Optiondef 46 "WINS/NBT Node Type" BYTE 0 comment="0x1 = B-node, 0x2 = P-node, 0x4 = M-node, 0x8 = H-node" 0 delete optionvalue 46 #Add Optiondef 47 "NetBIOS Scope ID" STRING 0 comment="NetBIOS over TCP/IP Scope ID" "" delete optionvalue 47 #Add Optiondef 48 "X Window System Font" IP#AddRESS 1 comment="Array of X Windows font servers" 0.0.0.0 delete optionvalue 48 #Add Optiondef 49 "X Window System Display" IP#AddRESS 1 comment="Array of X Windows Display Mgr servers" 0.0.0.0 delete optionvalue 49 #Add Optiondef 51 "Lease" DWORD 0 comment="Client IP #Address lease time in seconds" 0 delete optionvalue 51 set optionvalue 51 DWORD "2592000" set optionvalue 51 DWORD user="Default BOOTP Class" "86400" #Add Optiondef 58 "Renewal (T1) Time Value" DWORD 0 comment="Time between #Addr assignment to RENEWING state" 0 delete optionvalue 58 #Add Optiondef 59 "Rebinding (T2) Time Value" DWORD 0 comment="Time from #Addr assignment to REBINDING state" 0 delete optionvalue 59 #Add Optiondef 60 "ClassID" STRING 0 comment="Client type for RIS servers" "PXEClient" delete optionvalue 60 #Add Optiondef 64 "NIS+ Domain Name" STRING 0 comment="The name of the client's NIS+ domain." "" delete optionvalue 64 #Add Optiondef 65 "NIS+ Servers" IP#AddRESS 1 comment="A list of IP #Addresses indicating NIS+ servers" 0.0.0.0 delete optionvalue 65 #Add Optiondef 66 "Boot Server Host Name" STRING 0 comment="TFTP boot server host name" "" delete optionvalue 66 #Add Optiondef 67 "Bootfile Name" STRING 0 comment="Bootfile Name" "" delete optionvalue 67 #Add Optiondef 68 "Mobile IP Home Agents" IP#AddRESS 1 comment="Mobile IP home agents in priority order" 0.0.0.0 delete optionvalue 68 #Add Optiondef 69 "Simple Mail Transport Protocol (SMTP) Servers" IP#AddRESS 1 comment="List of SMTP servers available to the client" 0.0.0.0 delete optionvalue 69 #Add Optiondef 70 "Post Office Protocol (POP3) Servers" IP#AddRESS 1 comment="List of POP3 servers available to the client" 0.0.0.0 delete optionvalue 70 #Add Optiondef 71 "Network News Transport Protocol (NNTP) Servers" IP#AddRESS 1 comment="List of NNTP servers available to the client" 0.0.0.0 delete optionvalue 71 #Add Optiondef 72 "World Wide Web (WWW) Servers" IP#AddRESS 1 comment="List of WWW servers available to the client" 0.0.0.0 delete optionvalue 72 #Add Optiondef 73 "Finger Servers" IP#AddRESS 1 comment="List of Finger servers available to the client" 0.0.0.0 delete optionvalue 73 #Add Optiondef 74 "Internet Relay Chat (IRC) Servers" IP#AddRESS 1 comment="List of IRC servers available to the client" 0.0.0.0 delete optionvalue 74 #Add Optiondef 75 "StreetTalk Servers" IP#AddRESS 1 comment="List of StreetTalk servers available to the client" 0.0.0.0 delete optionvalue 75 #Add Optiondef 76 "StreetTalk Directory Assistance (STDA) Servers" IP#AddRESS 1 comment="List of STDA servers available to the client" 0.0.0.0 delete optionvalue 76 #Add Optiondef 252 "WPAD" STRING 0 comment="Расположение порта ISA сервера с функцией autodiscovery" "http://proxy.inet.services.novgaro.ru:80/wpad.dat" delete optionvalue 252 #Add Optiondef 1 "Microsoft Disable Netbios Option " DWORD 0 vendor="Microsoft Options" comment="Option for enabling or disabling Netbios for Microsoft Windows 2000 Clients" 1 delete optionvalue 1 vendor="Microsoft Options" #Add Optiondef 2 "Microsoft Release DHCP Lease On Shutdown Option" DWORD 0 vendor="Microsoft Options" comment="Option for enabling or disabling Windows 2000 Clients to release DHCP lease on shutdown" 0 delete optionvalue 2 vendor="Microsoft Options" #Add Optiondef 3 "Microsoft Default Router Metric Base" DWORD 0 vendor="Microsoft Options" comment="Default Router Base Metrics for Microsoft Windows 2000 Clients" 0 delete optionvalue 3 vendor="Microsoft Options" #Add Optiondef 1 "Microsoft Disable Netbios Option " DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Option for enabling or disabling Netbios for Microsoft Windows 2000 Clients" 1 delete optionvalue 1 vendor="Microsoft Windows 2000 Options" delete optionvalue 1 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" delete optionvalue 1 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" #Add Optiondef 2 "Microsoft Release DHCP Lease On Shutdown Option" DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Option for enabling or disabling Windows 2000 Clients to release DHCP lease on shutdown" 0 delete optionvalue 2 vendor="Microsoft Windows 2000 Options" delete optionvalue 2 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" delete optionvalue 2 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" #Add Optiondef 3 "Microsoft Default Router Metric Base" DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Default Router Base Metrics for Microsoft Windows 2000 Clients" 0 delete optionvalue 3 vendor="Microsoft Windows 2000 Options" delete optionvalue 3 vendor="Microsoft Windows 2000 Options" user="Default Routing and Remote Access Class" delete optionvalue 3 vendor="Microsoft Windows 2000 Options" user="Default BOOTP Class" add reservedip 172.31.1.1 00c0eb0528de "P03051901.novgaro.ru" "" "DHCP" commit online popd
Естественно, сценарий укоротил, не хочу светить зарезервированные адреса :-). Но суть ясна, я думаю. Имея такой файл, устанавливаем предварительно netsh.inf, сохраняем свой netsh скрипт как .netsh файл (скрипт можете собрать на базе приведённого выше примера). Правой кнопкой по файлу либо двойным кликом – и новые настройки DHCP уже в силе!
Самый внушительный блок Add Optiondef можно и опустить. Однако, для автоматического поиска прокси сервера для IE в частности Вам потребуется зарегистировать дополнительные параметры DHCP (смотрите описание 252 параметра). Поэтому я привёл описание всех опций, которые могли потребоваться.
В предложении server \\server.domain.ru
меняете на FQDN своего DHCP сервера.
Рекомендую Вам управлять DHCP исключительно сценариями. И самый простой вариант – NetSH. Плюс в таком подходе к конфигурированию – возможность сравнить конфигурации, без проблем перенести конфигурацию на другой сервер.
RSS комментарии
Обратная ссылка