Saturday, November 8, 2008

Add users to Team Foundation Server

All Team Foundation Server editions require users to be members of a Team Foundation Server group at the project level or server level. The level and group depend on the functionality that you want to enable for the user. For example, if you want to have a user create a team project, the user must have the Create New Projects permission set to Allow, must be assigned to the role of Content Manager in SQL Server Reporting Services, and must be assigned to the role of Administrator for Windows SharePoint Services. However, the user does not have to be a member of the local administrator group on the computer. For more information about users and roles, see the topic “Team Foundation Server Permissions” in the Team Foundation Server Administrator’s Guide on MSDN Library.

To add users to Team Foundation Server:

  1. Log on as a Team Foundation Administrator, open Team Explorer, and connect to the Team Foundation Server for which you are adding a user.

  2. From the Team menu, click Team Foundation Server Settings, and then click Group Membership.

  3. In the Global Groups dialog box, click Team Foundation Licensed Users and then click Properties.

  4. In the Team Foundation Server Group properties dialog box, click Windows User or Group, and then click Add.

  5. In the Select Users or Groups dialog box, type the user accounts you want to add, and then click Add.

  6. Click Close.

Note
You cannot use the Global Security group dialog box to add users to this group.
You can add individual user accounts but not a group account.

In this way the user can only connect to the server but can't create or access projects. To complete the configuration, you can use the TFS Admin Tool. It allows a TFS administrator to quickly add users to all three platforms utilized by Team Foundation Server (Team Foundation Server, Sharepoint and SQL Reporting Services) all through one common interface. The tool also allows administrators to change the current permissions on any of the three tiers, identify any errors and view all of the users and their permission sets across Team Foundation Server, Sharepoint, and SQL Reporting Services.

The program is written in C# and is released via CodePlex.

Tuesday, November 4, 2008

Asterisk / Trixbox: listen to calls in progress

With Asterisk or Trixbox it's possible to listen to calls in progress made by other clients.

Insert the line below into "extensions.conf" inside a customized context. In Trixbox or @home write it into "extensions_custom.conf "under [from-internal-custom]

for example:

exten => _61XXX,1,ChanSpy(SIP/${EXTEN:2},q)

with as many X as number of figures or chars in "names" of your extensions (3 in this exemple)

After a reload, is sufficent to type on telephon keypad 61206 to listen the extension 206 call

Asterisk / Trixbox: recording calls

With Asterisk or Trixbox its possible to record clients made calls.
To do it we have to insert the rows below into "extesion.conf" on Asterisk or into "exstension_custom.conf" on Trixbox. (PS: on Trixbox it's also possible to enable this function from the GUI)

exten => _61XXX,1,Monitor(wav,rec${EXTEN:2},m)
exten => _61XXX,2,ChanSpy(SIP/${EXTEN:2},q)
exten => _61XXX,3,Hangup

in /var/spool/asterisk/monitor we'll find the recordings in wav format, named rec"extensionNumber"

Thursday, October 16, 2008

Select Distinct on DataSet with Vb.Net

Functions below allow to do a "Select Distinct" query over a DataSet.

FieldNames is a string array with the name of field for the select distinct input.



Public Function SelectDistinct(ByVal SourceTable As DataTable, _
    ByVal ParamArray FieldNames() As String) As DataTable

    Dim lastValues() As Object
    Dim newTable As DataTable

    If FieldNames Is Nothing OrElse FieldNames.Length = 0 Then
        Throw New ArgumentNullException("FieldNames")
    End If

    lastValues = New Object(FieldNames.Length - 1) {}
    newTable = New DataTable

    For Each field As String In FieldNames
        newTable.Columns.Add(field, SourceTable.Columns(field).DataType)
    Next

    For Each Row As DataRow In SourceTable.Select("", String.Join(", ", FieldNames))
        If Not fieldValuesAreEqual(lastValues, Row, FieldNames) Then
            newTable.Rows.Add(createRowClone(Row, newTable.NewRow(), FieldNames))
            setLastValues(lastValues, Row, FieldNames)
        End If
    Next

    Return newTable
End Function



Private Function fieldValuesAreEqual(ByVal lastValues() As Object, _
    ByVal currentRow As DataRow, ByVal fieldNames() As String) As Boolean

    Dim areEqual As Boolean = True

    For i As Integer = 0 To fieldNames.Length - 1
        If lastValues(i) Is Nothing OrElse Not lastValues(i).Equals(currentRow(fieldNames(i))) Then
            areEqual = False
            Exit For
        End If
    Next

    Return areEqual
End Function



Private Function createRowClone(ByVal sourceRow As DataRow, _
    ByVal newRow As DataRow, ByVal fieldNames() As String) As DataRow

    For Each field As String In fieldNames
        newRow(field) = sourceRow(field)
    Next

    Return newRow
End Function



Private Shared Sub setLastValues(ByVal lastValues() As Object, _
    ByVal sourceRow As DataRow, ByVal fieldNames() As String)

    For i As Integer = 0 To fieldNames.Length - 1
        lastValues(i) = sourceRow(fieldNames(i))
    Next
End Sub

Friday, September 26, 2008

Unzipping a zip file with subfolder with SharpZipLib and VB.net

Unzipping routine using ICSharpCode (IC#Code) released open source dll, called SharpZipLib (#ZipLib), downloadable here


Imports ICSharpCode.SharpZipLib.Zip
......
If File.Exists(fileName) Then

    destPath = fileName.Substring(0, fileName.Length - 4)

    If Not Directory.Exists(destPath) Then
        Directory.CreateDirectory(destPath)
    Else
        For Each s As String In Directory.GetFiles(destPath)
            File.Delete(s)
        Next
    End If

    Dim inStream As New ZipInputStream(File.OpenRead(fileName))
    Dim outStream As FileStream
    Dim entry As ZipEntry
    Dim buff(2047) As Byte
    Dim bytes As Integer

    Do While True
        Try
            entry = inStream.GetNextEntry()
            If entry Is Nothing Then
                Exit Do
            End If

            If entry.Name.Last() = "/" Then
                Directory.CreateDirectory(destPath & "\" & _
                entry.Name.Replace("/", "\"))
            Else
                Try
                    outStream = File.Create(destPath & _
                    "\" & entry.Name, 2048)
                    Do While True
                        bytes = inStream.Read(buff, 0, 2048)
                        If bytes = 0 Then
                            Exit Do
                        End If
                        outStream.Write(buff, 0, bytes)
                    Loop
                    outStream.Close()
                Catch
                End Try
            End If
        Catch
ex As ZipException
            rtn += ex.Message & vbCrLf
        End Try
    Loop

    inStream.Close()
Else
    rtn = "File '" & fileName & "' not found."
End If