Show the policy status
Function ShowPolicyStatus (ByRef tdc As TDConnection)

' Show the policy status


    Dim aStatus, msg
    Set aStatus = tdc.PolicyStatus
    msg = ""

    Dim statString
    Select Case aStatus.VerificationStatus
        Case 0: statString = "Passed"
        Case 1: statString = "Passed with warnings"
        Case 2: statString = "Failed"
    End Select
    
    ' Add status information.
    '
    msg = msg & Chr(13) & "Domain Name: " & aStatus.DomainName
    msg = msg & Chr(13) & "Project Name: " & aStatus.Name
    msg = msg & Chr(13) & "Is Template: " & CStr(aStatus.IsTemplate)
    msg = msg & Chr(13) & "Verified Status: " & statString
    msg = msg & Chr(13) & "Last verification on: " & aStatus.LastVerificationTime
    msg = msg & Chr(13) & "Is Up-2-Date   : " & CStr(aStatus.IsUpToDate)
    msg = msg & Chr(13) & "Last propagation on: " & aStatus.LastPropagationTime

    ' Add list of administrators.
    '
    Dim admins
    Set admins = aStatus.Administrators

    Dim i%
    If (admins.Count > 0) Then
        msg = msg & Chr(13) & "Administrators:"
        For i = 1 To admins.Count
            msg = msg & Chr(13) & "- " & admins.Item(i).UserName
        Next
    End If

    ' Add linked template datails.
    '
    Dim tpl
    Set tpl = aStatus.LinkedTemplate
    If (tpl Is Nothing) Then
        msg = msg & Chr(13) & "Template: not linked."
    Else
        msg = msg & Chr(13) & "Template: " & "[" & aStatus.LinkedTemplate.DomainName & "].[" & aStatus.LinkedTemplate.Name & "]"
    End If

    MsgBox msg, 0, "Show Policy Status"

End Function