Lync user delegates where are stored in database


  • Hi !

    I would like to query database and find all delegates for Lync users, in which databases that is stored ? I would like to create SQL report for summary all users that have delegates for their account.


    jeudi 26 septembre 2013 11:34

Toutes les réponses

  • Hi,

    Check this SEFAutil

    SEFAUtil (secondary extension feature activation) enables Lync Server 2010 administrators and helpdesk agents to configure delegate-ringing and call-forwarding settings on behalf of a Lync Server user. This tool also allows administrators to query the call-routing settings that are published for a particular user.

    jeudi 26 septembre 2013 11:49
  • Hi !

    Thanks for that tool , it's helpful when I want to check one user, but if I have few hundreds users I would like to query globally settings and create matrix with users and delegates, could I use that tool for global reporting for all users and their delegates ?



    jeudi 26 septembre 2013 12:25
  • Hi,

    Here is the link - The Word document describing the Microsoft Lync Server 2010 Resource Kit Tools has a good description (Page 64) on how to run SEFAutil.

    You can script it for all users to get full details. 

    jeudi 26 septembre 2013 13:54
  • ok, I try to use that and it works, but I would like to receive all list of delegates also that delegates that are not checked by checkbox in delegates windows, for example I have 3 delegates and only for 2 of 3 delegates checkbox (Receive Calls) is marked, so I am going to find in database where that all 3 users for that specific users are stored also delegates that don't have marked that checkbox, it's possible by SQL ? probably yes, but I don't know how Lync it stored :(


    • Modifié user012az jeudi 26 septembre 2013 15:02 mistake
    jeudi 26 septembre 2013 15:02
  • I found there is a table Delegate in the RTC database. And you can find the same column from all tables. These tables must be related.

    Check the following link about “Query to Find Column from All Tables of Database”.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    vendredi 27 septembre 2013 08:34
  • Thanks for all ideas, but nothig found :(

    I have 5 databases on my sql sever : rtcab , rtcxds , rtcshared , xds , lis

    I tried to do backup all 5 db and do some changes in delegates and backup again. I restored all 5 databases in both versions but comparsion of that 2 version of all 5 db not help me :(

    Any other ideas ?



    mardi 1 octobre 2013 08:54
  • @ Kamil

    did you finally get the location for delegates?

    I have the same problem like you described above, figure out all existing entrys...

    Additional I would prefer writeing new delegations directly into Database instead of using SEFAutil.

    Thanks for reply


    jeudi 3 juillet 2014 15:25
  • Hi,

    Old post I know, but myself and a colleague spent some time yesterday writing a PowerShell script to capture this information.  Please see below

    Save as .ps1 and run FILENAME.PS1 ALL (for all users)



    $users = Get-CsUser | select sipaddress

    $runnumber = switch ($run)


            1 {"0..100"}

            2 {"101..200"}

            3 {"201..300"}

            4 {"301..400"}

            5 {"401..500"}

            6 {"501..600"}

                    7 {"37..37"}

                    ALL {"0..1000"}

                    default {"0..2"}


    $myusers = invoke-expression -command "`$users[$runnumber]"


    foreach ($user in $myusers)



    $thisresult = @()

    $urt = ""

    $callfw = ""


    $thisresult = "" | select Username, UserRingTime, CallForward,DelayRingDelegates,GroupPickupOrbit,ForwardImmediate

                    $user = $user.SipAddress.tostring().split(":")[1]

                    $cmd={ & 'c:\program files\microsoft lync server 2013\reskit\SEFAUtil.exe' $user /}

                    $result=invoke-command $cmd


                    write-output "----------"

                    $username = $result[0].split(" ")[2]

                    $matchstring = $result[4].split(":")[0]

           write-host "! $matchstring !"

                    if ( $matchstring -match "User Ring")


               $urt = $result[4].split(" ")[3].trim()

                       $callFW = $result[5].split(":")[2]



              { Write-host " outer else  "


                if ($matchstring -match "Delegate" )

                     { Write-host " match delegate"

                                    $thisresult.DelayRingDelegates = $result[4].split("(")[1]

                                    $thisresult.GroupPickupOrbit   = $result[5].split(":")[2]




                                    if ( $result[4] -match  "Forward immediate")


                                    $urt ="Forward Immediate"

                                    $callfw = $result[4].split(":")[2]





                                    Write-host " match inner else "

                            $urt = " Not Found"

                            $callFW = $result[4].split(":")[1].trim()




    $thisresult.username = $username

    $thisresult.UserRingTime = $urt

    $thisresult.CallForward = $callfw

    #write-host "username =  , urt = $urt,  callfw = $callfw"

    $Finalresult +=$thisresult


    $finalresult | sort-object -property username | export-csv result.csv -append -notypeInformation

    #$finalresult | sort-object -property username | where {$_.callforward -eq "False"}


    Hope this helps someone! :-)


    mardi 23 septembre 2014 09:29
  • Can you help me to figure out what parameters we need change in this script>? and where to define output file path to save ?

    Kulbir Singh

    vendredi 23 mars 2018 22:15