This script queries Skype for Business Server 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.       

This script collects Skype for Business Server objects including: LineURI, Private Line, Analouge Lines, Common Area Phones, RGS Workflows, Exchange UM Contacts, Trusted Applications, Conferencing Numbers, Meeting Rooms, Hybrid Application Endpoint (On-premises Resource Accounts).

v1.0 - Initial release
v1.4 - Added Get-CsMeetingRoom to data collection
v1.5 - Added Get-CsHybridApplicationEndpoint to data collection (20/11/2019)

Check out my blog here -

If you are looking for a GUI based version see Admin Tools