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

 

Advertisements

4 thoughts on “Lync Enterprise Voice oneliner: Find users with LineURI

  1. I wonder if this is not even faster?
    Get-CsUser -LdapFilter “((msRTCSIP-Line=*))” | Sort-Object -Property LineUri | Format-Table Displayname,LineURI -AutoSize

    • Hey Markus. Thanks for the tip. I ran a test on the two oneliners and LdapFilter was faster 80%ish of the times. Typically it was 15ms faster. It is a more geeky way of doing it but, definetly a good alternative :) I used Measure-Command to test the oneliners

      (Measure-Command {
      Get-CsUser -Filter {LineURI -ne $Null} | Sort-Object -Property LineUri | Format-Table Displayname,LineURI -AutoSize
      }).Milliseconds

      (Measure-Command{
      Get-CsUser -LdapFilter “((msRTCSIP-Line=*))” | Sort-Object -Property LineUri | Format-Table Displayname,LineURI -AutoSize
      }).Milliseconds

      Using filter gave 246ms
      Using ldapfilter gave 232ms

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s