Created
June 8, 2012 03:19
-
-
Save theagreeablecow/2893343 to your computer and use it in GitHub Desktop.
Lync Client Discovery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @user varchar(20) | |
set @user = '' | |
declare @ClientVer varchar(100) | |
set @ClientVer = '' | |
declare @server varchar(10) | |
Select (cast (RE.ClientApp as varchar (100))) as ClientVersion, R.UserAtHost as UserName, Reg.Fqdn | |
From [LYNC1\RTCLOCAL].rtcdyn.dbo.RegistrarEndpoint RE | |
Inner Join [LYNC1\RTCLOCAL].rtc.dbo.Resource R | |
on R.ResourceId = RE.OwnerId | |
Inner Join [LYNC1\RTCLOCAL].rtcdyn.dbo.Registrar Reg | |
on Reg.RegistrarId = RE.PrimaryRegistrarClusterId | |
where R.UserAtHost like '%' + @user + '%' | |
and (cast (RE.ClientApp as varchar (100))) like '%' + @ClientVer + '%' | |
union all | |
Select (cast (RE.ClientApp as varchar (100))) as ClientVersion, R.UserAtHost as UserName, Reg.Fqdn | |
From [LYNC2\RTCLOCAL].rtcdyn.dbo.RegistrarEndpoint RE | |
Inner Join [LYNC2\RTCLOCAL].rtc.dbo.Resource R | |
on R.ResourceId = RE.OwnerId | |
Inner Join [LYNC2\RTCLOCAL].rtcdyn.dbo.Registrar Reg | |
on Reg.RegistrarId = RE.PrimaryRegistrarClusterId | |
where R.UserAtHost like '%' + @user + '%' | |
and (cast (RE.ClientApp as varchar (100))) like '%' + @ClientVer + '%' | |
union all | |
Select (cast (RE.ClientApp as varchar (100))) as ClientVersion, R.UserAtHost as UserName, Reg.Fqdn | |
From [LYNC3\RTCLOCAL].rtcdyn.dbo.RegistrarEndpoint RE | |
Inner Join [LYNC3\RTCLOCAL].rtc.dbo.Resource R | |
on R.ResourceId = RE.OwnerId | |
Inner Join [LYNC3\RTCLOCAL].rtcdyn.dbo.Registrar Reg | |
on Reg.RegistrarId = RE.PrimaryRegistrarClusterId | |
where R.UserAtHost like '%' + @user + '%' | |
and (cast (RE.ClientApp as varchar (100))) like '%' + @ClientVer + '%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment