List Lync Users – automated Excel file

(Have a look at the newer, smarter, prettier, fancier version of this script here.)

This script isn’t big news, but it’s very handy and easy to use.
It allows you to remotely connect to one of your pools and create an Excel sheet, populated with the following:

Display Name SIP Address Registrar Pool Enterprise Voice Line URI

It’s basically a list you can hand to your customers and colleagues so they can keep track of changes.
Additionally, it helps spot Enterprise Voice enabled users that don’t have a Line URI or it’s misconfigured.

When you run the script it’ll ask your for your Credentials – You must Have appropriate Lync permissions:


It will then ask you for the FQDN of your Lync server or pool and will attempt to connect:

Lync Server

When connected, the script will immediately start creating the Excel file:

Creating Excel2

You can scroll up and down the Excel file but do not click anywhere on the spreadsheet. This causes the automated build to crash, and you’ll have to restart the script.

When completed, the script will notify you and close the remote PowerShell session it initiated.

Script Done

The pace is approx. a second per line, so if you have 5000 users this is the time to go and grab a cup of coffee.

The script can be downloaded here.

Updated October 7, 2014: Version 2.0 checks for your PS version. This script will only run on PS 3.0 or higher.

14 thoughts on “List Lync Users – automated Excel file

      1. I tried it from my laptop on the same domain, got errors through the powershell despite I have Excel installed!

        Tried from the front end, Yes it has no Excel installed but it almost returned the same error as from my laptop.

  1. I just tried to run and here’s what I get

    File D:\Users\xxxx\Desktop\LyncUsersExcel.ps1 cannot be loaded. The file D:\Users\xxxx\Desktop\LyncUsersExcel.p
    s1 is not digitally signed. The script will not execute on the system. Please see “get-help about_signing” for more det
    At line:1 char:45
    + D:\Users\abdelham\Desktop\LyncUsersExcel.ps1 <<<<
    + CategoryInfo : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

  2. found the file was blocked by explorer as protection
    when unblocked I ran the script and here’s what I got

    Missing property name after reference operator.
    At D:\Users\xxxx\Desktop\LyncUsersExcel.ps1:23 char:43
    + Write-Host Connecting to Pool $LyncServer. <<<< .. -ForegroundColor Yellow
    + CategoryInfo : ParserError: (.:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingPropertyName

    1. Hi kalam3adi,
      Mu guess is that you’re using an old(er) version of PowerShell. This script runs on PS 3 and 4.
      You can run $PSVersionTable on your machine to determine the version you’re using.

      Thanks for your feedback!

      1. OK
        Upgrading the powershell worked well, however I still have some errors

        pool1.xx.xx.xx failed with the following error message : The server
        certificate on the destination computer (pool1.xx.xx.xx:443) has the following errors:
        The SSL certificate could not be checked for revocation. The server used to check for revocation might be unreachable. For more information, see the
        about_Remote_Troubleshooting Help topic

      2. one thing that I must mention, I have 2 FE servers and one backend.
        The pool spans the 2 servers.

        is that going to make a difference???

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.