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.

get-assigned

 

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 :)

Lync Enterprise Voice oneliner: Find users with LineURI from a specific country

This oneliner helps you to find all users that has a LineURI defined in a Lync deployment

Get-CsUser -Filter {LineURI -like “tel:+47*”} | Sort-Object -Property LineUri | Format-Table Displayname,LineURI -AutoSize

  • Get-CsUser -Filter {LineURI -like “tel:+47*”}
    • Gets all the users with a LineUri defined with the +47 countrycode
    • -like requres that the number starts with tel:+47 wich is the start of a norwegian lineuri
    • -Filter  will get just the users we are interested in as is less resource intensive than Where-Object
  • | Sort-Object-PropertyLineUri
    • Takes the object from previous cmldet and sorts the object on the LineURI attribute
    • Will list all phone numbers in the correct order
  • | Format-TableDisplayname,LineURI-AutoSize
    • formats the output where we display the name of the user and the LineURI the user has

Lync Enterprise Voice oneliner: Find users with LineURI

This oneliner helps you to find all users that has a LineURI defined in a Lync deployment

Get-CsUser -Filter {LineURI -ne $Null} | Sort-Object -Property LineUri | Format-Table Displayname,LineURI -AutoSize

  • Get-CsUser-Filter {LineURI-ne $Null}
    • Gets all the users with a LineUri defined
    • -Filter  will get just the users we are interested in as is less resource intensive than Where-Object
  • | Sort-Object-PropertyLineUri
    • Takes the object from previous cmldet and sorts the object on the LineURI attribute
    • Will list all phone numbers in the correct order
  • | Format-TableDisplayname,LineURI-AutoSize
    • formats the output where we display the name of the user and the LineURI the user has

 

A few examples from the get-assignedlineuri

As with the search-lineuri script, I had to make parameters mandatory to make it as flexible as I wanted it to be for my usage. If the script is run without known parameters it will throw this custom error message, and I suggest running “get-help .\Get-AssignedLineURI.ps1 -Detailed” to get the complete list of options:

getass-ex1

One of my favorites when I try to get an overview over a new system, or just keeping tabs on an existing one, is the the showsummary in shell. It gives a quick overview over how many objects within the Lync system there are with a assigned lineuri:

getass-ex2

Then over to one my most used parameters. I use it in all my deployments, to get a detailed view over all the deployed lineURIs on all objects within Lync in one simple HTML document. Simply run Get-AssignedLineURI.ps1 -CreateHTMLOutput (with or without the -path parameter to control where the document is created):

getass-ex3

I think this will be enough for one post, but I will be back with more examples in the following weeks.

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:

search-ex1

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

search-ex2

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:

search-ex3

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