This article is based on the Microsoft KB entitled setting up DHCP for devices. In particular, I hope this clarifies how to configure DHCP in the Lync environment to allow a phone to sign in with a correct DHCP options The basic requirement for a Lync phone to sign in, include NTP time and NTP server, DHCP address, DNS address, VLAN ID , and Lync pool URL (option 43). There are other MS articles to cover DNS devices, NTP devices and others in the KB Deploying Lync Phone Edition. This discussion is focused around the DHCPUTIL.exe command and how to set DHCP options using the command. Options used include 1,2,3,4,5,6,15,42,119 and 120. How can we set these?
Lync DHCP options Script 1,2,3,4,5,43 and 120
Lync 2010 and 2013 comes with an executable for adding the options for the DHCP server. If you are using a 64 bit server for DHCP, then begin by copying the the files dhcputil.exe and dhcpconfigscript.bat command from the following folder C:\Program Files\Common Files\Microsoft Lync Server 2013. I found that I needed to copy the files to my DHCP server. See figure 1.
I found the best resource on this subject is from Jeff Schertz. See the Schertz Blog. I will share my screen shots for the process. Use his article to follow along and these screens will hopefully tie together. Thanks Jeff for your work. I would never been able to understand Lync without your steady contributions to UC.
To set the DHCP server options, First review what data the command uses:
- Open Power Shell.
- run the command .\dhcputil.exe -sipserver FQDN (example .\dhcputil.exe -sipserver lync.mydomain.com)
- You can see the values used by seeing the output of the command. They are based on the sipserver FQDN you entered (Figure 2). The long numbers are constant representations of the options being implemented. They are not of concern at this time. Unless you have an error
X64 DHCP Server
- If you have a 64 bit DHCP server, then you can perform the following
- run .\dhcputil.exe -sipserver FQDN -runconfigscript
- In my case I had to remove the delete values as from the batch file located at C:\Program Files\Common Files\Microsoft Lync Server 2013 (Figure 3). I then copied to my DHCP server. I deleted the highlighted options below.
The revised script looks like below. this is the dhcpconfigscript.bat file, edited to remove the option 120 removal portion. This is not to be confused with “runconfigscript”, which is a switch operator, invoking the dhcputil.exe to use this file as a source:
Script 1 (dhcpconfigscript.bat)
netsh dhcp server add optiondef 120 UCSipServer Binary 0 comment=”Sip Server Fqdn”
netsh dhcp server set optionvalue 120 Binary %3
netsh dhcp server add class MSUCClient “UC Vendor Class Id” “%2″ 1
netsh dhcp server add optiondef 1 UCIdentifier Binary 0 Vendor=MSUCClient comment=”UC Identifier”
netsh dhcp server set optionvalue 1 Binary vendor=MSUCClient %4
netsh dhcp server add optiondef 2 URLScheme Binary 0 Vendor=MSUCClient comment=”URL Scheme”
netsh dhcp server set optionvalue 2 Binary vendor=MSUCClient %5
netsh dhcp server add optiondef 3 WebServerFqdn Binary 0 Vendor=MSUCClient comment=”Web Server Fqdn”
netsh dhcp server set optionvalue 3 Binary vendor=MSUCClient %6
if not %7 == NULL (netsh dhcp server add optiondef 4 WebServerPort Binary 0 Vendor=MSUCClient comment=”Web Server Port”)
if not %7 == NULL (netsh dhcp server set optionvalue 4 Binary vendor=MSUCClient %7)
netsh dhcp server add optiondef 5 CertProvRelPath Binary 0 Vendor=MSUCClient comment=”Cert Prov Relative Path”
netsh dhcp server set optionvalue 5 Binary vendor=MSUCClient %8
I ran the command .\dhcputil.exe -sipserver FQDN -runconfigscript using power shell and making sure the batch file DHCPConfigScript.bat is located in the same directory as dhcputil.exe. Once this is run, restart the DNS services. It may take a minute to complete. The results look like this (figure 5):
32 Bit DHCP server
For a 32 bit server, The Dhcputil.exe will not work. We are basically accomplishing the same objective on a 32 bit DHCP server. The only difference is we are going to ad some variables to the batch file input. this will allow the batch file to configure the options properly. you can simply take the text from the above (script1) command and save on the dhcp server. Then do the following-
- Run DHCPCONFIGSCRIP.BAT (script 1 without the executable). However- you need to run it in a certain way- read on before running.
- Open Power Shell
- run Set-ExecutionPolicy –unrestricted
- Run dhcputil.exe -sipserver fqdnofyoursipserver (on a 64 bit server or lync server)
- Take the output from the results as seen in figure 6
- Past the output from figure 6 using “.\” and then the DHCPConfigScript.bat and all of the rest of the command, all the way to the ….2E737663
- Here is the example syntax – .\DHCPConfigScript.bat Configure MS-UC-Client 00046C796E63073172656576657303636F6D00 4D53 2D55432D436C69656E74 6874747073 6C796E632E317265657665732E636F6D 343433 2F4365727450726F762F4365727450726F766973696F6E69 6E67536572766963652E737663
- Restart the DNS service.
- look in the DHCP options for the new settings (Figure 7)
NTP time. DHCP option 4 and 42
To set the NTP time DHCP option, Go to DHCP scope options and choose configure (figure 8)
Choose options 4 and 42 – Time Server and NTP servers. Place the correct values here, the time server should be the PDC emulator and the NTP server is found by w32tm /query /configuration
Create an A record for the NTP time server and an SRV record for the NTP server as well. I will again defer to Jeff Schertz as his article includes options at greater depth.
DHCP option 119
I am adding based on the article configuring lync server for phone edition devices. This article is the go to resource for the DHCP options settings. I am including the here because I learned this option from this article.
1. Right click the ipv4 under the authorized DHCP server and choose set predefined options:
2. Click Add- and manually enter the following
3. Once complete right click scope options and choose configure options (figure 8). and enter a string value for the domain name (figure 11)
3. Once complete right click scope options and choose configure options (figure 8). and enter a string value for the domain name (figure 10)
This complete setup of the options for UCIdentifier (001), URL Scheme (002),WebServerFqdn (003) , WebServerPort (004), CertProvREIPath (005), DNS search list (119), UC sip server (120). Time Server (004) and NTP Server (042). If you don’t have option 3,6, and 15 add router, DNS servers and DNS domain Name by using the configure options (figure 8).
Thank you for reading and I hope the screen shots help if you have any trouble getting the DCHP scope options input into your Lync Environment. Figure 7 is has the DHCP options listed so you can alos go in and add manually if you need to but this hopefully helps to automate that process.