Lync 2010/2013 Script to find available numbers in a Lync deployment

LyncPSHaving worked on a couple of Enterprise Voice deployments since the launch of Lync Server 2013 I am still missing a feature that I honestly thought would be incorporated in to Lync by now. It is the ability to find unused available numbers in a given number range assigned to the Lync Server based on Unassigned Numbers. I even hoped it would be possible to assign a teluri to users through a drop down list in the Silverlight GUI since the information is available in the server. I hope this will be available in a future Cumulative Update.

This is almost how I wrote it back in january 2011 when I created the List-UnusedNumber.ps1 script. This is still true and I have therefore revitalized the old script and upgraded it and tested it on Lync 2013. The original script was also featured on the Lync PowerShell blog, which was a huge thing for me. Continue reading

Script to find available telephone numbers in Lync Server 2010

Having worked on a couple of Enterprise Voice deployments since the launch of Lync Server 2010 I have been missing a feature that I honestly thought would be incorporated by launch. It is the ability to find unused available numbers in a given number range assigned to the Lync Server based on Unassigned Numbers. I even hoped it would be possible to assign a teluri to users through a drop down list in the Silverlight GUI since the information is available in the server. I hope this will be available in a later Service Pack or Cumulative Update.

Since this is a feature I really want, I have tried to create a PowerShell Script to find out how many numbers are available in any given number range and what they are. First of all I want to declare that I am a PowerShell novice so my syntax may not be that optimized. The script works, though there’s a lot of variables and loops that I am sure could be done better. The script does the following:

  • It goes through each entry in Unassigned Phone Numbers that needs to be populated with all numbers series available to the Lync Server
  • Then it gets all teluri’s for all the users, dial-in conferencing and Exchange UM contacts
    • I didn’t find the response group command to get the teluri while I was at it, will add this in an update
  • Then the string gets “washed” for “tel:+47” where 47 is the hardcoded region code for Norway
    • The string also get “washed” for any extension numbers
  • After that a new string gets created to get rid of property types and so on
  • I use Compare-Object to compare the Unassigned Number array with the used numbers
    • Run a check to find what numbers where not used and count them
  • Then I find out what the total number of unused numbers are and write the output

I hope this script will come useful to anyone who needs this feature and that others can use this to and adapt it to their needs. Please share any improvements that could be made to the script. Enjoy!

https://msunified.net/lyncdownloads/script-list-unusednumbers-ps1/