Another quick post to show how you can quickly deploy fully working DHCP server with multiple scopes in a matter of seconds. In my case it was a single server with 90 very different scopes and doing this manually would be just soo boring and long that’s unreal. Unfortunately Windows Server 2012 wasn’t an option so no PowerShell love but Windows Server 2008 R2 is still pretty decent and using netsh wasn’t as painful as it seemed. To get us started we need to install the DHCP Server role and start the required service (dhcpserver):
1 2 3 |
<strong>start /w ocsetup DHCPServer sc config dhcpserver start= auto net start dhcpserver</strong> |
Next step is to authorize DHCP server in the enterprise so we can actually use it to dish out IP addresses:
1 |
<strong>netsh dhcp add server %COMPUTERNAME% ip_address_goes_here</strong> |
Other useful commands here would include:
To deauthorize the server –
1 |
<strong>netsh dhcp delete server %COMPUTERNAME% ip_address_goes_here</strong> |
and to list all authorized servers –
1 |
<strong>netsh dhcp show server</strong> |