Updated Get-SfBNumbers.ps1

As shown at Microsoft Ignite 2015 this script handles phone numbers in a Skype for Business deployment. I have gotten some great feedback on the script and now I have updated the script with new features, fixes and optimizations. Let me know how the script works for you in the comment field below

Here are version 1.0 changes

  • Added and verified $ReportPieChartHTML parameter and set it to $True as default
  • Fixed bug when connecting to SQL monitoring CDR databases with named instances and mirrored SQL
  • Optimized adding user activity to internal database and added parameter $ReportUserActivity that is default set to $False that will skip it since it may take up to 20 minutes
  • Added and verified options to automatically classify numbers to Gold and Silver with parameter $AutoclassifyNumbers that is default set to $True
  • Added option to classify Bronze numbers with parameter $ReserveBronzeNumbers which is default set to $False, do not run
  • Added check if Server 2010 to skip Get-CsMeetingRooms as the cmdlet does not exist in 2010
  • Added option to specify extension length with parameter $ExtensionLength that is default set to 4

Download the script

Link: https://gallery.technet.microsoft.com/lync/Get-Skype-for-Business-f2af9408

Watch the recording of the session at Ignite

Releasing Get-SfBNumbers.ps1

As shown at Microsoft Ignite 2015 here is the script demoed called Get-SfBNumbers.net. At this time the tool is in beta since it has only been tested in a handfull of deployments.

Teaser3

Download

Link: https://gallery.technet.microsoft.com/lync/Get-Skype-for-Business-f2af9408

Description

This script will get the next available number of any provided number range from

  • Unassinged Numbers
  • array in the script
  • parameter input when running the script

It will check for

  • disabled users in Active Directory
  • connect to the LcsCDR to get users that has not logged on for 30 days or more
  • Connect to LcsCDR to check for activity on numbers, both unassigned and assigned

It supports

  • Lync Server 2010, Lync Server 2013, Skype for Business Server 2015
  • Reservation of numbers based on categories like Gold, Silver, Bronze, Special and Excluded
    • From Array in the script or Unassigned Numbers
  • Reservations of number ranges within larger number ranges for special services like future callcenter or response groups
  • Retention of numbers based on disabled in Active Directory, last logon time and activity on numbers

Reporting supported

  • Default behaviour is GridView with all numbers and summary in the PowerShell window
  • Export to of all information to CSV
  • Create a summary in PieChart as HTML

Teaser2

Refernces

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

 

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

Get-UnusedNumbers V3 Released

Just a quick post to let you know the Get-UnusedNumbers.ps1 has been updated and uploaded to the Technet Gallery.

The script has gone through some major changes since it was first released in January 2011 on msunified.net , V1 article, V2 article. I will go through use cases, examples and explain the script in future posts. But here are the highlights of v3:

  • CHANGE: Moved the routine of collecting all DID’s to a separate function so it’s easier to reuse for other scripts and functions
  • NEW FEATURES: Created a new function that generates extensions and check if duplicates exists
  • EXAMPLES: Added three examples showing how the functions can be used