Parallel Universe - MS Tech Blog

The ramblings of a PFE

Update your Lync Note with a Quote of the Day – API Powershell

Update your Lync Note with a Quote of the Day – API Powershell

  • Comments 2
  • Likes

 

Following on playing with the API this script is just for fun. I have created a scheduled task that runs daily and updates the quote of the day for my Lync note…. have fun!

p.s it requires internet access!

Here is the sample code

image

and here is my updated Lync Client

 

image

 

here is the code so copy and paste

#Load Assembly
$assemblyPath = “C:\Program Files (x86)\Microsoft Office 2013\LyncSDK\Assemblies\Desktop\Microsoft.Lync.Model.DLL”
Import-Module $assemblyPath
$client = [Microsoft.Lync.Model.LyncClient]::GetClient()

#Get Qoute of the Day
$url = "http://feeds.feedburner.com/brainyquote/QUOTEBR"
$data = Invoke-RestMethod -Uri $url
$qotd = $data[0].description

#Publish QoTD to Note
$instanceSelf = $Client.Self
$noteInfo = New-Object 'System.Collections.Generic.Dictionary[Microsoft.Lync.Model.PublishableContactInformationType, object]'
$noteInfo.Add([Microsoft.Lync.Model.PublishableContactInformationType]::PersonalNote, $qotd)
$Publishnote = $instanceSelf.BeginPublishContactInformation($noteInfo, $null, $null)
$instanceself.EndPublishContactInformation($Publishnote)

Comments
  • cool stuff thanks

  • Where do i put this code in? Do I save it somewhere? thanks for sharing!!

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment