Simple certificate management with Excel and notification

All certificates have an expiration date, which is usually a long time in the future. Who remembers a certificate that was purchased 2 years ago or even longer? Some CAs send reminder e-mails, but not all. For internal CAs, perhaps the CA-Reporter can help. If you only have a few purchased certificates, you can manage them using Excel and a little PowerShell, simply enter data in the list, create a scheduled task for the Powershell and you're done, just a simple certificate management:

Certificate management

The PowerShell script can read the Excel file and send reminder e-mails to a central contact person and to the applicant's e-mail address.

image

To send an e-mail, only the first 5 lines in the "Certificate management.ps1" file need to be adapted:

$Filepath = "C:\Simple certificate management\Certificate management.xlsx"
$MailanSubject = "yes"
$smtpserver = "192.168.10.1"
$sender = "cert@frankysweb.de"
$recipient = "certadmin@frankysweb.de"

The script and the Excel file do not have to be in the same folder; a network drive can also be specified. Excel must be installed on the computer that executes the PS1 file. The PS1 file can be started once a day via task scheduling so that reminder e-mails are sent. A simple task that starts the Powershell.exe with the specification of the PS1 file is sufficient for task scheduling:

image

Program:

Powershell.exe

Arguments:

-Command "& 'C:\Simple certificate management\Certificate management.ps1′"

Download:

2 thoughts on “Einfache Zertifikatsverwaltung mit Excel und Benachrichtigung”

  1. Hi Frank,

    ich habe nun einmal 3 Testeinträge in die Tabelle gemacht. 3 mal meine Mailadresse eingetragen und verschiedene Ablaufdaten alle kleiner 60 Tage. Alle anderen Felder habe ich auch gefüllt.
    Im Script habe ich dann als recipent noch ein Postfach eingetragen welches die Zusammenfassung bekommen soll.

    1. Problem welches ggfs. keins ist denn die Mails an die Antragsteller werden alle zugestellt:
    Öffne Excel Datei…
    Werte Zertifikate aus…
    Versende Mail an: [MAILADRESSE]
    Fehler beim Aufrufen der Methode, da [System.Management.Automation.PSObject] keine Methode mit dem Namen „op_Addition“ enthält.
    In C:\[SCRIPT-ABLAGEORT.ps1].ps1:65 Zeichen:3
    + $Certwarning += new-object PSObject -property @{Antragsteller=“$antragsteller“ …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Versende Mail an: [MAILADRESSE]
    Fehler beim Aufrufen der Methode, da [System.Management.Automation.PSObject] keine Methode mit dem Namen „op_Addition“ enthält.
    In C:\[SCRIPT-ABLAGEORT.ps1]:65 Zeichen:3
    + $Certwarning += new-object PSObject -property @{Antragsteller=“$antragsteller“ …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Versende Mail an: [MAILADRESSE]
    Versende Übersicht an: [MAILADRESSE]

    2. Problem:An alle Antragsteller wird brav die Mail verschickt, an das Postfach der Zusammenfassung auch, jedoch immer nur mit dem Eintrag aus der 2. Zeile. Die anderen beiden Einträge werden nicht angezeigt.

    Hast du eine Lösung?!
    Danke und Gruß
    Peter

    Reply
    • Hallo Peter,

      da ich gerade selber über dieses Problem gestolpert bin und es noch keine Antwort gibt antworte ich mal auf diesen alten Beitrag.

      Damit der Versand der Zusammenfassung klappt, muß man einmal die Zeile „$Certwarning =@()“ relativ am Anfang einfügen (z.B. unter „$CertStates =@()“) und zum anderen die Zeile „$Certwarning += new-object PSObject -property …“ ändern in „$Certwarning += $cert“

      Dann kommen keine Fehler mehr und die Zusammenfassung ist sinnvoll gefüllt.

      Gruß,
      Jan

      Reply

Leave a Comment