Need to add a shed load of contacts to Skype for Business - AutoHotKey to the rescue!

A customer had the need to add approx 200 external contacts to a single Skype for Business user where there was no access to the backend database or PowerShell.

To do this I went back in the mists of time and cracked open a copy of AutoHotKey....

.....well, I did once I disabled Windows Defender:

So now I've got it downloaded and installed lets get on with the show:

We have two files:

  • Adds.txt which contains the sipuri's of all people you want to add (these can be people in your organisation and external).
  • ContactsAdd.ahk which is the actual code.

You can download these both from my DropBox (no love for OneDrive now they have curtailed the amount of free space!), but the code is here if you want to play with it by hand.

Note that this is very rough and ready code so probably could be tidied up considerably. Usual warranties apply, test in a lab, not for production use, YMMV, don't eat yellow snow. etc. etc.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;start SfB/Lync
run, Lync.exe

;bring SfB to the foregroud - change this if using Lync 2010 or 2013 in "classic" mode
winwaitactive, Skype for Business 

;start a loop and open adds.txt for reading
loop, read, adds.txt
;read the first line of the file and fill a variable called A-LoopReadLine with the file
loop, parse, A_LoopReadLine, %A_Tab%
;send some tabs, spaces, down keys etc to get to "add a contact not in my organisation"
send, {Tab}{Tab}{Tab}{Tab}{Tab}{Space}{Down}{Enter}{Enter}
;send the contents of the variable to SfB
Send, %A_LoopReadLine%
;Hit enter
send, {Enter}
;Move from Contacts tab to next tab....
Send, {Control Down} 2 {control Up}
;....and back again
Send, {Control Down} 1 {control Up}
;Loops round until the end of the file

Latest CU for Skype for Business out. Moves version to 6.0.9319.235

 Following components updated:

  •  Performance Counters
  •  Response Group Service
  •  Conferencing Attendant
  •  Web Components Server
  •  Front End server and Edge server
  •  Core Components

Noted Additions, Fixes and Updates:
Adds the Active Directory Authentication Library (ADAL) feature to Microsoft Skype for Business Server 2015.

Windows 10 users who use Edge can't join a meeting from Skype for Business Web App

The Response Group service crashes when you change the value in the dbo.Agents table

An improvement to allow PSTN callers to join a Skype for Business meeting without a PIN.

You can't join a meeting from outside Lync 2013, Lync 2010, or Skype for Business on iOS 9.2 and later.

Server-side conversation history in branch site deployments is no longer supported in the March 2016 cumulative update. (no further information at this URL)

Call transfer from a PSTN call to a federated user fails in Skype for Business Server 2015

Event 1000 occurs and the Rtcsrv.exe process crashes on a Skype for Business Server 2015 Front End server

Event ID 47067 and the HTTP stack goes into Overflow in Skype for Business Server 2015

Debug-CsInterPoolReplication returns "BATCHES OUT OF SYNC" error in Skype for Business Server 2015

Tab key expansion process returns non-relevant parameters to Shared Line Appearance cmdlets

"Endpoint failed to login" error when you run SLA-related cmdlets more than 20 times in Skype for Business Server 2015

Delegate data is not removed when you run the Remove-CsSlaDelegates cmdlet in Skype for Business Server 2015

ADFS 3.0 is supported for OAuth tokens in Skype for Business Server 2015

Can't prepare an Active Directory forest in Skype for Business Server 2015

Looks like the only database with an update is rtcxds:

Updated 22nd March
KB3141121 goes live.

Updated 31st March
All KB's live.