hi can I get the lync contacts and them status in a listview with C#? I want to get all users from ad to a listview in asp.net web application and control wheater a user is online or offline.
Asked
Active
Viewed 9,489 times
1
-
1have you tried any thing...have you gone thorugh the lync api MSDN , and other blogs available...first do some R&D and do some coding then come again – Shafqat Masood May 14 '13 at 07:03
-
1What research have you done so far? Did you try anything? – Daniel Hilgarth May 14 '13 at 07:03
-
i search how i can do this but i don't find anythink that can help me – Tarasov May 14 '13 at 07:07
2 Answers
4
Yes you can. Check the following links to integrate lync in asp.net applications:
Lync integration:
http://sharpsplash.wordpress.com/2012/08/03/integrate-microsoft-lync-into-a-asp-net-web-application/
Show MS Lync presence status:

Carlos Landeras
- 11,025
- 11
- 56
- 82
-
8This should be a comment, because it will be useless when the links go dead. – Daniel Hilgarth May 14 '13 at 07:06
0
If Carlos' links do go dead, here is the TL;DR. This Javascript taps into the NAME.dll in C:\Program Files\MicrosoftOffice\Office14:
<script>
$(function() {
//hide the ooui if the user scrolls.
(window).scroll(function() {
HideOOUI();
});
$('#lyncspan').hover(function() {
//show ooui on mouseover event
ShowOOUI();
}, function() {
//hide ooui on mouseout event
HideOOUI();
});
});
var sipUri = "your.contact@your.domain.com";
var nameCtrl = new ActiveXObject('Name.NameCtrl.1');
if (nameCtrl.PresenceEnabled)
{
nameCtrl.OnStatusChange = onStatusChange;
nameCtrl.GetStatus(sipUri, "lyncspan");
}
function onStatusChange(name, status, id)
{
//In a real world application you would display
//a status icon instead of an alert
alert(name + ", " + status + ", " + id);
}
function ShowOOUI()
{
nameCtrl.ShowOOUI(sipUri, 0, 15, 15);
}
function HideOOUI()
{
nameCtrl.HideOOUI();
}
</script>
<span id="lyncspan" style="border-style: solid">Your Contact<span>

SteveCav
- 6,649
- 1
- 50
- 52