I tried this with the following command:
$x = Get-CsRgsAgentGroup -Identity service:ApplicationServer:LyncFEG.DOMAIN.co.uk/6156f51c-f0b3-4685-b7cc-2b1282a76548 -Name 'ITSupport'
$x.AgentsByUri.Add("sip:user@DOMAIN.com")
Set-CsRgsAgentGroup -Instance $x
But this appear to have no effect.
I can see that the user I am interested in is already in the group when I call $x.AgentsByUri
:
AbsolutePath : user@domain.com
AbsoluteUri : sip:user@domain.com
LocalPath : user@domain.com
Authority :
HostNameType : Unknown
IsDefaultPort : True
IsFile : False
IsLoopback : False
PathAndQuery : user@domain.com
Segments : {user@domain.com}
IsUnc : False
Host :
Port : -1
Query :
Fragment :
Scheme : sip
OriginalString : sip:user@domain.com
DnsSafeHost :
IdnHost :
IsAbsoluteUri : True
UserEscaped : False
UserInfo :
But when I check their response group settings manually (via skype), I can see that they are not 'signed in' to that group, so they are not receiving any calls made to the group:
I also compared those properties to those of a user who is 'signed in', and they look exactly the same.
Finally, I tried removing the user from the group before adding them (with first method mentioned), but this has no effect.
Is it possible to sign a Lync 2013 user into their call response group using PowerShell?
One way of doing this would be to run the following JSCript:
var ie = WSH.CreateObject('InternetExplorer.Application');
url = "https://LYNCSERVER/RgsClients/Tab.aspx",
ie.visible = true;
ie.Navigate(url);
while (ie.readyState != 4) WSH.Sleep(25);
ie.document.getElementById('ctl05_ctl00_ctl04_ctl00_ctl00_ctl01').click();
ie.quit()
Where 'ctl05_ctl00_ctl04_ctl00_ctl00_ctl01'
is the ID of the checkbox which signs the user in to the required response group (in this case, IT Support).
This solution does work quite well, but I would rather not use it as:
It interacts with the UI of a browser rather than directly with the Lync server, SDK or API (still not sure if this is possible) - this doesn't seem like the ideal method.
This script would need to run individually on each user's PC (unless we could implement some sort of impersonation), where I would prefer a solution which can be run centrally.