I am developing a wpf application using Lync SDK that sits on a windows 2012R2 server which I access using a remote desktop session. I am trying to keep the lync account logged in to be always available, even when there is no user logged into the computer.
I set a timer to tick every 15 seconds that runs this code:
if (client.State == ClientState.SignedIn)
{
counter++;
Console.WriteLine("Account is green: " + counter);
Dictionary<PublishableContactInformationType, object> status = new Dictionary<PublishableContactInformationType, object>();
status.Add(PublishableContactInformationType.Availability, Microsoft.Lync.Controls.ContactAvailability.Free);
client.Self.BeginPublishContactInformation(status, PublicationCallback, time);
Console.WriteLine(client.Self.Contact.GetContactInformation(ContactInformationType.Activity));
}
While this does set the status of the user to be Available when someone is logged in (even if no one is using the computer), whenever I disconnect from the remote desktop session (and the server locks but is still running), the status goes to away.
Is there some way for me to get it to ignore if the computer is locked or not?