none
Lync user delegates where are stored in database

    Question

  • 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.

    Thanks,|
    Kamil

    jeudi 26 septembre 2013 11:34

Toutes les réponses

  • Hi,

    Check this SEFAutil 

    http://blogs.technet.com/b/jenstr/archive/2010/12/07/how-to-get-sefautil-running.aspx

    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 ?

    Thanks,

    Kamil

    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.

    http://www.microsoft.com/en-gb/download/details.aspx?id=21165

    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 :(

    Thanks,
    Kamil


    • Modifié kam0200 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”.

    http://blog.sqlauthority.com/2008/08/06/sql-server-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
    Modérateur
  • 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 ?

    Thanks,

    Kamil

    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

    Martin

    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)

    ------------------------------------------------------------------------------------------------------------------------------------

    param($run=1)

    $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]"

    $Finalresult=@()

    foreach ($user in $myusers)

    {

    $user

    $thisresult = @()

    $urt = ""

    $callfw = ""

    $username=""

    $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 /server:fepool01.oninteroute.com}

                    $result=invoke-command $cmd

                    $result

                    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]

              }

                    Else

              { Write-host " outer else  "

                                   

                if ($matchstring -match "Delegate" )

                     { Write-host " match delegate"

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

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

                     }

                        Else

                                    {

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

                                    {

                                    $urt ="Forward Immediate"

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

                         

                                    }

                                    Else

                                    {

                                    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! :-)

    Wayne

    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