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


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!

A few examples from search-lineuri

It’s about time to give a few examples of our scripts, and I thought I’d start out with a few basics from the search-linerui script.

I have tried to create an accurate help description with in the script, so everything should be explained with the use of  “get-help .\search-lineuri.ps1 -Detailed” but here are a few pointers with screenshots as well.

One of the errors I see when other use the script is when the run it without any parameters. When the script was first created it did not require any parameters, but in order to do all the things I want to with it I had to make parameters mandatory. If you run the script without any valid parameters, you should receive the following custom error prompt:


Try run the script with at least one parameter like “-search” to get a result:


Please observe I have set a validation on the number parameter ($URIsearch) at least 2 digits and maximum 20 digits long ([ValidateLength(2,20)]). It will cause a system error if a search is tried with fewer or longer extensions:


That’s all for now. I will post more screen shots and usage examples in the following weeks

Error in -ListAsGridView output from Search-LineURI.ps1

I was recently altered about an error in the Search-LineURI.ps1 script. (Thanks Alessio ;)

There seems to be an error when searching for an extension, and asking for the result in the ListAsGridView format. The error occurs when there is only one identity is found, and looks like this:

searchuri error

I have not been able to replicate the error when the search results in more than one result:

searchuri error2

I will try to fix this in an upcoming release, but have not found a good way to capture the error yet. If anyone know to handle this error, pleas let me know, and I’ll put your name in there.


Sometimes it can be hard to find where a number is configured in the system. Not all numbers are shown in the CSCP. And the only way find it is through poweshell commands.

You basically have to search for an identity’s lineuri with these commands: Get-CsUser, Get-CsAnalogDevice, Get-CsCommonAreaPhone, Get-CsExUmContact, Get-CsDialInConferencingAccessNumber, Get-CsTrustedApplicationEndpoint, Get-CsRgsWorkflow.

This script, does it all for you. Search for the number, and it will look through all the possibilities and show you where the number is located.

Search-LineURI is intended for Lync 2013, Windows server 2012 and PowerShell v3

Current version of the script is v2.2 (of December 2013). A new release is planned just before the upcoming Lync Conference in February, so stay tuned. To find the current release of the script, just follow the link to Search-LineURI in the menu.