Lync Script – Get All Assigned Numbers

2
5384

This script queries Lync for all assigned numbers and displays in a formatted table with the option to export to CSV. During processing LineURI’s are run against a regex pattern to extract the DDI/DID and the extension to a separate column.

Numbers Queried: LineURI, Private Line, Analouge Lines, Common Area Phones, RGS Workflows, Exchange UM Contacts, Trusted Applications and Conferencing Numbers.

http://gallery.technet.microsoft.com/Lync-Get-All-Assigned-8c1328a0

 

2 COMMENTS

  1. Hi Andrew, great tool. Thanks.
    I wanted to add a field for “users office location”
    How do I add to the search parameters in your Get all assigned numbers script ?

    • Great to hear you like the script. The office location is an AD attribute and is not returned as part of Get-CsUser I don’t believe. I’ve done something similar before like this:
      foreach ($AssignedNumber in $AssignedNumbers)
      {
      $ADMatch = Get-ADObject -SearchBase $ADPath -LDAPFilter “(msrtcsip-primaryuseraddress=$($AssignedNumber.SipAddress))” -Properties name, company, department, msrtcsip-primaryuseraddress, serialnumber
      $myObject2 = New-Object System.Object
      $myObject2 | Add-Member -type NoteProperty -name “LineURI” -Value $AssignedNumber.LineURI
      $myObject2 | Add-Member -type NoteProperty -name “DDI” -Value $AssignedNumber.DDI
      $myObject2 | Add-Member -type NoteProperty -name “Ext” -Value $AssignedNumber.Ext
      $myObject2 | Add-Member -type NoteProperty -name “Type” -Value $AssignedNumber.Type
      $myObject2 | Add-Member -type NoteProperty -name “Name” -Value $AssignedNumber.Name
      $myObject2 | Add-Member -type NoteProperty -name “SipAddress” -Value $AssignedNumber.SipAddress
      $myObject2 | Add-Member -type NoteProperty -name “Company” -Value ([string]$ADMatch.company)
      $myObject2 | Add-Member -type NoteProperty -name “Department” -Value ([string]$ADMatch.department)
      $myObject2 | Add-Member -type NoteProperty -name “EmployeeId” -Value ([string]$ADMatch.serialnumber)

      $Array2 += $myObject2

      }

LEAVE A REPLY

Please enter your comment!
Please enter your name here