How to send a skype message using Powershell?

Powershell from Microsoft used to send a automated message in skype for business messenger.

Lync 2013 SDK installed in the target machine and used the Microsoft.Lync.Model.DLL available in the program files. API’s available in the DLL has been utilized to trigger all the required functionalities such as send a message, join a meeting room, join a conference room etc

Download and install the powershell using the below URL;

To manage the Lync 2013 SDK in the windows x64 bit machine; Refer the below URL;

Please find the below code snippet to trigger an automated message using the powershell script and refer the below video to know about the script functionality in detail;

$assemblyPath = “C:\Program Files (x86)\Microsoft Office 2013\LyncSDK\Assemblies\Desktop\Microsoft.Lync.Model.DLL”

Import-Module $assemblyPath

$IMType = 1

$PlainText = 0

$cl = [Microsoft.Lync.Model.LyncClient]::GetClient()

$conv = $cl.ConversationManager.AddConversation()

$username = “”

$getuser = $cl.ContactManager.GetContactByUri($username)

$null = $conv.AddParticipant($getuser)

$msg = New-Object “System.Collections.Generic.Dictionary[Microsoft.Lync.Model.Conversation.InstantMessageContentType,String]”

$msg.Add($PlainText, “Test message by robo using powershell”)$m = $conv.Modalities[$IMType]

$null = $m.BeginSendMessage($msg, $null, $msg)

For more scripts to automate skype for business, please use my github repo;



3 thoughts on “How to send a skype message using Powershell?

  1. My script is not working. Is it mandatory to install Lync 2013 ??? Actually I installed 32bit Lync instead of 64bit and now I am not able to uninstall it . What should I do ???


    1. You should install 32-bit only and the same assembly will be available in the below location
      C:\Program Files (x86)\Microsoft Office 2013\LyncSDK\Assemblies\Desktop\Microsoft.Lync.Model.DLL


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s