Get-AssignedLineURI has been updated twice

Get-AssignedLineURI has seen two updated since my previous post. The first update came back in June, and the second one just yesterday.

I am trying my best to add information I find useful, and incorporate these as soon as I have time. My latest additions are most tied to license counting. So many of my customers have the headace of knowing how many licenses the have, what they have deployed and if the required functionality is being used.

My latest addition is a connection to the monitor database, to verify user last logon, and the use of conferencing for a particular user. I also copied the send_email function from the backup script. This script can now be run as a task, and send a report to a desired mail address.

Here’s a short list of my updates:

V 3.6 – June 2015:

  • New feature: If a Monitor database is detected, and connection is possible, the script will now add “last log on” and “last conference initiated” information to the output

V 3.7 – September 2015

  • New feature: LicinfoHTML -> A parameter to gather license info and add it to the html output
  • New feature: Send the report in an e-mail


License count in HTML output

One of the new features I would like to highlight is the license count in the HTML output.

By using -LicInfoHTML and -CreateHTMLOutput togehter, you should get a summary on top of the HTML report similar to the following image:

report summary

Listed above are the total number of users, how many of them have only peer-2-peer functionality, how many have the enterprise license (conferencing) and how many enterprise voice enabled users there are. Along with the previous information added by counting devices.

Using Monitor Data

I added the -usemonitordatabase back in June, but forgot to post about it. But it is a very useful addition for gathering information about your deployment. Using this switch requires access to the monitor database (both user rights and network access), and will increase the time taken to complete the script.

Connecting to the Monitor Database adds a wealth of information, but I have chosen to focus on three pieces of the puzzle. The last logon preformed by the user, the last time he/she initiated a conference and whether or not the user has an enterprise license. Adding these as columns to the end of the line for each user, you should get information similar to the following:


In the example above you can see there is a user who has not been logged in for the duration of the log files, there are users who initiates conferences, and there are users not assigned with conference rights.

This information can be useful when deciding who gets to keep their enterprise license or not (if saving cost is an issue), identify users who do not log on and ccould be disabled or maybe encouraged to log on and participate.

Two words of warning regarding the information above:

  • This report is based upon logged data. Check your retention time to figure out how “valid” the above statements are. Needles to say, the longer the period of data history, the more accurate the report is.
  • If a user has not logged in for a while, that is no reason to disable that user. But could be a reason to investigate if the user should be disabled or not. A long absence from logging in can be due to Holiday, maternity/paternity leave or other valid reasons. (Again, depending on your history of data, this information can be inaccurate)

I use the “last logged in” information mostly during a deployment of a new customer. It can easily identify late adopters of the solution.


The script is available for download at the Technet Gallery

I hope you find these changes useful. And as always, I appreciate feedback ;)


Get-AssignedLineURI.ps1 v 3_5 released

I am still going through my scripts and verifying how they work on Skype for Business server. Get-AssignedLineURI was next in line. And as with my other scripts, I have taken the time to fix minor bugs and add features to the releases. Here are the highlights of version 3.5:

  • Code Cleanup: Moving parameters into sets, to avoid unintentional errors
  • New feature: Listing users enabled for EV, but without a lineURI present
  • New feature: Listing users disabled for EV, but with a lineURI present
  • More information: Added sip domain to the output of the search
  • Beta feature: Get the unassigned numbers from CsUnassignedNumber and quicly identify available numbers, First, first 10 or entire list
  • Beta feature: Manual number range for the unused assigned section

Moving parameters into sets, to avoid unintentional errors

As the scripts grow, they tend to have more switches added. Some of these could actually make the other not work. And to avoid conflicting switches, I have moved them into sets. Run “get-help .\get-assignedlineuri.ps1” to get a clear view of the possible combinations (or read the help file).

Listing users enabled for EV, but without a lineURI present and Listing users disabled for EV, but with a lineURI present

It is not uncommon  to make mistakes when working with EV. Two of the most common mistakes I run into is when admins disable enterprise voice and forget to remove it from the LineURI, or removes the LineURI and forget to disable EV. The first scenario doesn’t free up the number, and the second scenario still requires a EV license for the user. I used to run one-liners at deployments, to identify these “errors”, but decided I could use this script instead.

To identify if you have one the following issues, simply use the -ShowSummaryInShell switch:


To identify these objects, use the -CreateHTMLOutput switch and study the outputfile:




Get the unassigned numbers from CsUnassignedNumber range

As the script was made to gather all the lineuri’s in the deployment, it was easy to incorporate a switch to identify non-used numbers based of the unassigned range:


Manual number range for the unused assigned section

And while I was at it, I created an option to provide a manual start and end range. This way it’s is easy to find a number in a specific range, and the script doesn’t have to go through all your ranges to find just on number.



License information

I have also gone through the license information output, and I think the new output makes more sense:



The script is available for download at the Technet Gallery

I hope you find these changes useful. And as always, I appreciate feedback ;)

V 3_4 of Search-lineuri.ps1 released

I have gone through this script, and verified it’s compatibility with Skype for Business server. And while doing so, and I did a few changes for the script. Here are the highlights of v 3.4:

  • Cleanup: Using paramter sets to seperate the different options (see comment below)
  • Bugfix: URIsearch is now mandatory when using -search parameter
  • Change: Default directory is now “UCDoc” (see comment below)
  • Change: Only one parameter for filename: $fileXML
  • Bugfix: Running a test, to avoid known issues with get-csmeetingroom and Lync 2010  (see comment below)

Cleanup: Using paramter sets to seperate the different options

The script have a lot of different switches, which really should not be mixed. In previous versions it was up to the user to avoid these errors. New parameter sets should now prevent a bad mix from ever happening.

Default directory is now “UCDoc”

The default path used to be “c:\Lync Documentation”. I changed the path to “c:\UCDoc” as a more neutral choice.

Running a test, to avoid known issues with get-csmeetingroom and Lync 2010

To avoid blood red text (on in some instances script hangs), I now run a test for the software version before running get-csmeetingroom (not available in Lync 2010 versions).

Hope find these updates useful, and I do appreciate feedback if you have questions or suggestions.

The script can be downloaded from the Technet Gallery

Speaking at TechED EU 2014

Did you know both Ståle and I are speaking at TechED in Barcelona this year?

Ståle is having a session on how to succeed with mobile devices and enterprise voice:

I will be presenting a session on backup and restore of Lync:

We’re both really excited about this opportunity, and we hope to see you in Barcelona

Get-AssignedLineURI updated

I couldn’t just update the search-lineuri without going through the get-assignedlineuri.ps1 as well?

I have rewritten the script in much the same way as I wrote search script (parts of the code are now almost identical), and it saved me a lot of “space” and time. I have tried to reduce the number of times I gather information to a minimum, and to carry the found information through all the different functions and jobs.

Highlights from this update includes:

  • BUGFIX: CommonAreaPhone error fixed. Thanks to Peter
  • CODE CHANGE: crated new functions, tried to make them work smarter together.
  • NEW FEATURE: Progress bar to give an indication of progress in huge systems
  • DELETED FEATURE: -splitext is no longer a valid option, but run on all queries by default
  • BETA FEATURE: Summarize the numbers of Licenses required. Beta only, feedback wanted!


REQUEST: If you know exactly how licensing work, please test my beta portion of the script and see if it is correct. It is built upon the following assumptions:

Basic CAL: Is a user enabled for Lync, but has no conferencing policy which allows 3-party audio, video or sharing. Nor is the user able to schedule a conference (if anyone knows exactly which settings are behind the shift from basic to enterprise, please explain :)

Enterprise CAL: A user enabled for Lync with all functions, with out enterprise voice

Basic CAL, and Plus CAL: The same as a Basic CAL, but this user has Enterprise Voice enabled

Enterprise CAL ans Plus CAL: All the good things in one basket, no restrictions.

If you know my assumptions are wrong, have something to add or suggest, please let me know.

search-lineuri.ps1 v 3.3 released

I guess I have hit the script-zone right now. Just a few days back I released the “get-userandpolicy.ps1” at my own site, and now I’m ready to let you know the search-lineuri.ps1 has gone through some changes.

The highlights from this new version is:

  • BUGFIX: SaveToXml no longer throws an error when you find only one match!
  • Code change:Function rewritten and search code changed to save time and space.
  • NEW FEATURE: Powershell output is not generated by write-host anymore :)
  • NEW FEATURE: Added column for “type” of endpoint, easy to tell if it is a user, room, rgs or whatever.
  • NEW FEATURE: Splitting line uri into EXT and DID
  • NEW FEATURE: Progress bar

I have tried to make the script run more efficient, and to create a more useful output in this version. I have been able to do so by removing 50% of my script, then add the new features as mandatory options in the main function. The progress bar got added to give the admin an indication of some kind of activity. In large deployments, the previous version of the script could take some time to run and give no indication at all. Now, the progress bar gets updated for every get-cs* command it runs.

I hope you find the tool useful. You can down load it by following the link in the menu, or right here!

How I used get-assignedlineuri to identify users with a missing EXT

(and prevented a couple of helpdesk calls when login to conference failed)

Here is another example of how I use the get-assignedLineURI in my deployments

I run my script with the following switch: .\Get-AssignedLineURI.ps1 -ListAsGridView

Then I use simple filters in gridview to list all users with a LineURI where EXT is empty.



This simple task identified 12 users with a missing EXT (among 300 users) in just a couple of seconds.

Using this information it was easy to fix these users, without them ever knowing they had an issue :)