Examples: GetUserPolicySettings method

  1. This agent gets the Setup policy document for the /Acme namespace and displays some items.
    Sub Initialize
      Dim session As New NotesSession
      Dim doc As NotesDocument
      Dim msg As String
      Set doc = session.GetUserPolicySettings("Central/Acme", _
      "", POLICYSETTINGS_SETUP, "/Acme")
      msg = "LocAllCatalogServer = " & _
      GetName(doc.LocAllCatalogServer(0)) & Chr(13)
      msg = msg & "LocAllDirectoryServer = " & _
      GetName(doc.LocAllDirectoryServer(0)) & Chr(13)
      msg = msg & "LocAllSametimeServer = " & _
      GetName(doc.LocAllSametimeServer(0))
      Messagebox msg,, "Setup policy for /Acme"
    End Sub
    
    Function GetName(n As String) As String
      If n = "" Then
        GetName = "<None>"
      Else
        GetName = n
      End If
    End Function
  2. This agent gets the Setup policy document for Kayak Guy/Acme and displays some items.
    Sub Initialize
      Dim session As New NotesSession
      Dim doc As NotesDocument
      Dim msg As String
      Set doc = session.GetUserPolicySettings("Central/Acme", _
      "Kayak Guy/Acme", POLICYSETTINGS_SETUP)
      msg = "LocAllCatalogServer = " & _
      GetName(doc.LocAllCatalogServer(0)) & Chr(13)
      msg = msg & "LocAllDirectoryServer = " & _
      GetName(doc.LocAllDirectoryServer(0)) & Chr(13)
      msg = msg & "LocAllSametimeServer = " & _
      GetName(doc.LocAllSametimeServer(0))
      Messagebox msg,, "Setup policy for /Acme"
    End Sub
    
    Function GetName(n As String) As String
      If n = "" Then
        GetName = "<None>"
      Else
        GetName = n
      End If
    End Function