Tuesday, April 4, 2017

Running Sonus SWe Lite "To-Go"

Finally, the Sonus SWe Lite is out, and its exciting times. This is a great VM to use in your environment, but it also means that you can have your very own SBC to test configs, and play with any time you like.

If you are like me, I use Oracle VirtualBox for all my VMs on my machine. I am not going to go into the reasoning as to why I use VirtualBox, I am sure many out there can explain it better than I can.

However, the SWe Lite VM only comes in 3 flavours, Hyper-V, VMWare, and KVM hypervisors. I took the VMWare package and imported it into VirtualBox, but it failed straight off the bat. After several trials, I have finally found the tweaks to make this work...

First, create your own virtual machine, and do not import the OVF (or OVA) file...

After creating the VM (with no disks attached); copy the VMDK files from the OVA file to their new home...

Next attach the disks to the VM using the Oracle VBox GUI (or the CLI if you like that sort of thing)...

Now for the trick that took me a few hours to figure out. You need to have 5 NICs and not 4 (the maximum you can see in the GUI). The only way to do this, is via the command line interface

N.B. If you are feeling brave, you can add it manually by editing the vbox file (Yes ... it says don't edit it .. but you can .. as long as you have VBox closed while you do it). Just in case you are, here is a screenshot of what mine looks like now...

 Once you have set this up correctly, you should now see in your GUI, the 5 interfaces...

Now you are ready to start the SWe Lite and configure the SBC. I recommend you have a read of Greig's well written post on the subject.

Tuesday, March 21, 2017

Upload AD Photos to Office 365

So, an interesting issue I came across the other day. My customer wanted to copy all photos from AD to Office 365. Since I hate doing manual labor, or leaving it to each user to re-upload their pictures, I came up with this simple script.

All you have to do is enter your Office 365 admin credentials into the script, and run it from a Domain Admin account within your environment.

# Set Credentials
$Username = "admin@tenant.onmicrosoft.com"
$Password = ConvertTo-SecureString 'MyPassword' -AsPlainText -Force
$UserCredential = New-Object System.Management.Automation.PSCredential $Username, $Password

#Connect to O365 Exchange Online
$ConnectionURI = "https://outlook.office365.com/powershell-liveid/?proxymethod=rps"
$EXSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $ConnectionURI -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $EXSession -AllowClobber

#Get Mailboxes
$Mailboxes = (Get-MailBox -ResultSize Unlimited |?{$_.IsDirSynced -eq "True"})

foreach($Mailbox in $Mailboxes){
  $ADPhoto = $Null
  $ADPhoto = (Get-AdUser -Identity $Mailbox.Alias -Properties thumbnailPhoto).thumbnailPhoto
  If($ADPhoto.Length -ne 0){
    Write-Host -ForegroundColor Green "Uploading Picture for $($Mailbox.Name)"
    Set-UserPhoto -Identity $Mailbox.Alias -PictureData ([byte[]]$ADPhoto) -Confirm:$False

Remove-PSSession $EXSession

Please let me know if you find a better way of doing this.

P.S. don't worry about the errors, as I have not put any error checking into this script.

Monday, February 6, 2017

Office 365 Wizards

UPDATE: Microsoft have moved away from the configure.microsoft.com website, and they have not yet updated their links to find out how to get to these tools. I will keep you updated when I find out where these tools went.

I have recently been looking at the different wizards that Microsoft provide in their Office 365 tenancy, and thought it might help some people to see them all in one place...

If anyone finds any discrepancies or new ones that I haven't added, please let me know.

Tuesday, August 2, 2016

Moving from On-Premises to Skype for Business Online

This is a gotcha which took me two days to figure out. I was moving a customer from a broken Skype for Business on-premises to O365 Skype for Business Online.

Why go through the pain of hybrid, if the users never used the system in the first place. What I found is there is a lack of documentation on what are the steps to move in a big-bang scenario. So here goes....

  1. Remove all users from your on-prem deployment
  2. Make sure the users are not licensed for Skype for Business Online yet (if they are, remove it)
  3. Make sure that "ALL" msRTCSIP-* attributes are null, and have propagated to all your DCs
  4. Do another directory sync to O365 using your ADDConnect server
  5. Assign License on O365
  6. Test User Connectivity
What got me here was step "3" .. All attributes were Null except for msRTCSIP-DeploymentLocator which was set to "SRV:" ... in a normal deployment this would be good because it means automatically detect the server. In O365 world, this means the user is On-Prem and don't enable them for Skype for Busienss.

Powershell Command to remove it..

Get-ADUser -SearchBase "OU=Users,DC=contoso,DC=local" -Filter * |Set-ADUser -Clear "msRTCSIP-DeploymentLocator"

Sunday, July 17, 2016

Phone Number Mismatch

I have been at many sites where the phone numbers on the AD contact is not the same as what is configured on Lync/SfB (Skype for Business).

Since SfB is the single source of truth when it comes to which number the user will ultimately answer on; I have devised a quick script that will match those two numbers up, and make sure that all AD contacts that have a Lync/SfB account have the correct phone number associated with them.

Hope this helps a few people out there...

P.S. This script can be easily modified to make other changes to contacts as required.

v.0.1 - 2016-07-18 -Invoke-CsNumberMatch.v.0.1.zip

Thursday, June 2, 2016

Sonus SBC Call Actions

I haven't found a place that explains the real life use case for this; so I thought I would write one for anyone that may search one day for how to do this.

I usually use this as a first step in the call flow, to manipulate the call before it gets to the routing stage.

As a simple example (don't want to get too complicated here). Let's say you want to mask certain caller IDs based on the "department" field in AD.

First thing, you need to setup the AD integration (lots of details on Google about how to do this), and make sure you synchronise (or otherwise leave it set to online) the AD attributes:

  • msRTCSIP-Line
  • department
Once you have got that working, you should create a manipulation table that will make the required changes to your call based on certain rules. In our case, it should check the "department" field and change the CallingNumber based on that.

Next an "Action" needs to be created to direct the call flow. In our example, we need to call to continue down its path regardless of the outcome.

This action will need to be used in an "Action Set" to modify the call flow. Again, in this case, we will allow the call to continue down the same path regardless. Quick gotcha here, the "Continue" option in the "Action Set" does not mean continue the call; it means continue the processing of the rules, so if you put "Continue" the call will fail...

Finally, you need to apply this "Action Set" to a signalling group for it to take affect. In our case, we will apply it to the "To/From SfB" so that it will be intercepted before the call is made out to the PSTN...

Tuesday, May 24, 2016

Last Login Timestamp

Ok ... here is one that I have used with some of my customers to clean up their user database ...

This script will go through a pool or all the pools in the deployment and check the last login timestamp for all the users that have logged in to each of the member servers (or SBAs).

You can use the -Unique switch to get only the latest login or drop the switch to get all timestamps available in the deployment.

You have also the option of producing the results in a Grid format, or a CSV file. Alternatively, do not specify any output format, and the result will be an array of objects that you can use to pipe into other commands.

If you get an error reading from the SQL database, you might not have access to that server's RTCLocal database; or you may need to open the correct ports (check out the infamous Get-CsConnections.ps1 script by Pat Richard on how to do that).

Hope this helps, and as always your feedback is highly appreciated.

v.0.01 - 2016-05-25 - Get-CsUserLastLogin.v.0.01.zip