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.

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

Get-AssignedLineURI v3.3 released

Here is a post to let our followers know we are still committed to this project and still writing code :)

Tonight I updated my Get-AssignedLineURI.ps1 v3.3

The update contain one bugfix and one change.

BUGFIX: Now trusted endpoint count is ONLY counting endpoints with LineURI
CHANGE: ListAsGridView now includes ext and did as separate values

Download the script from the link above, and please provide feedback if you find bugs or have input on “missing” functionality.

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.

Use a custom number range with Get-UnusedNumbers.ps1

A big ask for the script has been to use a custom number range. The script has been dependent on that Unassigned Numbers has been defined. I am happy to announce that you are now able to use a custom range with the Get-Unused function found within the script.

How to use a custom number range

Get-Unused -RangeStart +47232323001111 -RangeEnd +47232323001190 -Name “Custom Range Norway”

  • RangeStart needs the number to be in the e.164 format
  • RangeEnd needs to be within a reasonable range of RangeStart and in the e.164 format
  • Name is optional and you can call it what fits your deployment
  • Will return the next available number

unused1

Get-Unused -RangeStart +47232323001111 -RangeEnd +47232323001190 -Name “Custom Range Norway” -ListAll $true

  • RangeStart needs the number to be in the e.164 format
  • RangeEnd needs to be within a reasonable range of RangeStart and in the e.164 format
  • Name is optional and you can call it what fits your deployment
  • ListAll set to $true will list all available numbers

listunused2

Get the script at TechNet Gallery: http://gallery.technet.microsoft.com/Find-next-available-number-58391c72