Thursday, 29 October 2015

Generating Lync/Skype Option 120 Values for DHCP Servers

If your Lync or Skype for Business deployment includes Lync Phone Edition devices, you are probably familiar with the DHCP configuration work necessary to get phones to find the Lync or Skype pool for registration and log in.

The standard way is to use DHCPUtil.exe to give you all the values you need for your DHCP server settings. This works, but can be tedious if you have a lot of servers to configure - a PowerShell script would be better.

I recently needed to reconfigure our DHCP servers for a number of Lync server changes, and wanted a quick way to generate Option 120 values. After a little bit of research I found out how the Option 120 value is constructed. There is a nice write-up on 'Chris and Robin's Technology Blog', here.

So now that I know what the finished value looks like, I could write the PowerShell script. It turned out to be pretty simple. The only extra step I added was to include the option to split the string up into characters separated by a colon, as that is the format our non-Microsoft DHCP server requires.

Thursday, 16 July 2015

Getting UM Voicemail Greetings in Exchange 2013

Back in 2012 I posted a script to audit Exchange UM greetings.  The script worked nicely for Exchange 2010 but, because of some cmdlet changes, it no longer works in Exchange 2013.  I still needed to be able to audit UM greetings, but had to come up with a new method to do it.

To solve the problem I found a way to use the Exchange Web Services Managed API to return the information I needed from the mailbox.

I wrote a new script which used the EWS API to look inside the mailbox and search for the special hidden messages which contain the UM greetings.  As an added bonus, the new script can also download the greeting audio and save it to disk.

Tuesday, 9 June 2015

Uploading an Exchange UM Voicemail Greeting

A colleague recently asked if I knew of a way to upload an audio file as an Exchange UM voice-mail greeting message - you can do this through Exchange for UM attendants, but not mailboxes. The background of the request is that we use Exchange UM for handling inbound calls, and calls which cannot be routed to a team or queue go to a team mailbox rather than an individuals. We have around 80 of these, and were looking at changing their greetings. Having to manually dial into each one and record the new greeting seemed cumbersome.

I had some experience with programmatically retrieving voice-mail greeting recordings from Exchange UM, so I guess that this might be possible too. It turns out that with the Exchange Web Services Managed API it is possible, and works fairly well.

The main caveat with this approach is that you need to be mindful of the size and quality of the WAV file you are uploading. I found that it worked well with a 16KHz, mono, audio file. I tested files up to about 350KB. With some higher-rate files the upload succeeded, but when calling the mailbox Exchange announced that 'a system error had occurred'. This problem could be resolved by re-recording another greeting over the phone.

The script does not support other files types, such as mp3, etc.

Tuesday, 17 February 2015

Retrieving Hi-Res Photos from an Exchange Mailbox

As anyone running Lync 2013, Exchange 2013, and SharePoint 2013 may already know, Exchange provides a mechanism to store hi-res user profile photos in the Exchange mailbox, replacing the photos stored in the thumbnailPhoto AD attribute in many use cases.

Typically the Exchange Management Shell cmdlets Set-UserPhoto and Get-UserPhoto are used to store and retrieve the photos, and they can also be retrieved from Exchange using Exchange Web Services by visiting a URL like

The user photo sizes are 48x48, 64x64, 96x96x 120x120, 240x240, 360x360, 504x504, and 648x648. When a photo is uploaded Exchange creates resized images up to the maximum the source image will support. For example, a 1024x1024 image will be uploaded in all resolutions, but a 420x420 image will be uploaded in resolutions up to 360x360. If a resolution higher than those stored is requested, the highest available will be returned.

I was recently troubleshooting an issue where the photos for a particular user were misbehaving, and one particular resolution photo was not updating correctly. I wanted to know exactly what data was stored in the Exchange mailbox for the user. I've created a PowerShell script which will use the Exchange Web Services API to retrieve the user photos directly from a mailbox in all resolutions actually stored, along with the date the photo was last updated.

Friday, 13 February 2015

Auditing Exchange Rooms for Double Bookings

I recently wrote a post over on the Exchange Server TechNet forum about how we have seen an increase in meeting room double bookings since upgrading from Exchange 2010 to Exchange 2013. I won't repeat it all here (you can read all the details over there), but the bottom line is that in certain situations Exchange 2013 accepts room double bookings.

We're working through the process of getting the Exchange Server product group to recognise that the new behaviour is not ideal, and one of the data points we needed was how many times we have had rooms double booked.

To get the information I came up with a PowerShell script which utilizes the Exchange Web Services API to query mailboxes and identify instances where rooms are double-booked.