NOTESSIDAN

Allt om Lotus Notes & Domino




Add notification when certificates is about to expire

If certificates in IBM Notes expires things get complicated. Here is a simple way to avoid this



Use script below in a daily scheduled agent (do not run on weekends) to recieve a notification when certificates is about to expire.
If will notify you by email 7 days before expiration and also on the same day it will expire

Add the scheduled agent to names.nsf on the server


Sub Initialize

On Error GoTo e

Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.Currentdatabase

Dim nvec As NotesViewEntryCollection
Dim view As NotesView
Set view = db.getView("PeopleCertExpiration")
Set nvec = view.Allentries
Dim i As Integer, entry As notesviewentry

Dim maildoc As NotesDocument, rt As notesrichtextitem
Set maildoc = db.Createdocument()
maildoc.Form = "Memo"
maildoc.Subject = "Certificates is about to expire in the next 7 days"
Set rt = maildoc.Createrichtextitem("Body")
Dim cv As String
Dim a As Integer, b As Integer, c As integer

Call rt.Appendtext("This notification is sent out daily (mon-fri) as long as there are certificates that are about to expire in the next 7 days")
call rt.Addnewline(2)

For i = 1 To nvec.count
Set entry = nvec.Getnthentry(i)
cv = entry.Columnvalues(1)
Select Case cv
Case "Expires in the next 7 days":
If a<1 Then
Call rt.Addnewline(2)
rt.Appendtext("Expires in the next 7 days")
Call rt.Addnewline(2)
End If
Call rt.Appendtext(entry.Columnvalues(4))
Call rt.Addtab(2)
Call rt.Appendtext("Expiration Date : " + CStr(entry.Columnvalues(3)))
Call rt.Addnewline(1)
a = a + 1
Case "Expires Today":
If b<1 Then
Call rt.Addnewline(2)
rt.Appendtext("Expires Today")
Call rt.Addnewline(2)
End If
Call rt.Appendtext(entry.Columnvalues(4))
Call rt.Addtab(2)
Call rt.Appendtext("Expiration Date : " + CStr(entry.Columnvalues(3)))
Call rt.Addnewline(1)
b = b + 1

Case Else

End Select
Next
Dim sarr As Variant
sarr = Evaluate(|"emailnotification1@acme.com":"emailnotification2@acme.com"|)

If a>0 Or b>0 Then
Call rt.Addnewline(3)
Call rt.Appendtext("Open Expiration view -> ")
Call rt.Appenddoclink(view,"Link to expiration view")
Call rt.Addnewline(5)
Call maildoc.send(False,sarr)

End If


Exit Sub
e:
Print Error,Erl
End Sub



Relevanta Poster på Notessidan:



Fler Poster om:

Fler bloggar om:

Technorati:

Delicious:
Publicerad 2014-04-15 | Kommentarer: 3 | Läsningar:

Kommentarer

Patrick Kwinten ( 2014-04-16 10:53:16 )

Thomas ( 2014-04-16 11:39:00 )

David Brown ( 2016-03-31 15:39:00 )



Sök på Notessidan
Thomas Adrian
ThomasCertifierad utvecklare och administratör inom Notes & Domino

Kontakta mig







Senaste Sökningarna på Notessidan
Sön - sharepoint (R:1)
Sön - räkna and antal and besökare (R:0)
Sön - browser (R:17)
Sön - stoppar and mail (R:1)
Sön - korrupt (R:3)
Sön - böcker (R:0)
Sön - kalendern (R:12)
Sön - feature (R:15)
Sön - print and mime (R:2)
Sön - länka (R:0)
Sön - databasen (R:94)
Sön - access (R:47)
Sön - outlook (R:15)
Sön - webanvändare (R:0)
Sön - google and maps (R:6)
Sön - juffe (R:2)
Sön - uidoc.print (R:1)
Sön - java and lotusscript (R:26)
Sön - besök (R:0)




Databasstatistik Blogg
Uppdateras var 15:e Minut

Antal Poster:562
Antal Kommentarer: 1381
Alla sidvisningar idag:
Unika Besökare idag:
Databasstorlek: 186,75Mb
Fixup: 2019-07-23 00:31:06
FT:2019-07-24 08:13:53
DB Procent använd: 99,3
Antal Agenter: 42
Antal Formulär: 65
Antal Vyer: 60
Antal Dokument: 7933
Antal Image Resources: 108
Antal Subformulär: 18
Antal Scriptbibliotek: 11
Totalt Antal Designelement: 576
Antal Attachments: 159
Antal Konflikter: 0
Server version 1: 405
Server version 2: Release 9.0.1FP9|August 14, 2017
Server Plattform: Windows/64
Ändrad: 2019-07-24 09:10:25
Server Tidszon: Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=131$ZN=W. Europe
Region:
Kommentarsspam Idag: 8
Kommentarsspam Totalt: 17975


BlogRankers.com

Top Sites at iWEBTOOL.com

Fight Spam! Click Here!

Bloggtoppen.se

Listed on BlogShares

Increase website traffic

Top Internet Blogs

Site Checker