PowerShell your ServiceManager & ITAM: Get Hardware Maintenance Expiry Information

Hi All !

There are millions of exampled out there to PowerShell your Service Manager and  i dont want to replicate them. So in this Blog Series i will focus on real world examples people have with Service Manager and Provance (2014 Standard or Enterprise).

The first one is about automatic notification of to-be-expired maintenance agreements.

Lets assume you have Provance 2014 and Hardware Maintenance Agreements with a Start  and End Date. Those agreements have related Assets linked to it and contracts managers defined.

You want to get notified periodically about contract expiration and want to know which assets are affected. The timespan  you want to look into the future is configurable and you have the choice to get a HTML Report as a file or an HTML E-Mail send to the agreement manager.

Below is a picture of the idea which agreements are selected.

Powershell your SCSM Blog
Yellow agreements are reported because they are inside the „DueDate“ timeframe

The script will collect those agreement find the linked computer assets and generate a report similar to  the one below.

MaintExpiryExampleReport
Example Report

Ok, now for the magic behind all this.

1.) The scheduler

As this is programmed in Powershell you can use SMA, SCSM Powershell Workflow or Orchestrator to fire it, i decided to use task scheduler on the workflow server. The reasons for this decision are that task scheduler is available on every Windows Server, its free and simple to configure. If you dont wat to use it, simply use yur favorite powershell integration tool.

2.) The script

As announced here it uses native scsm commandlets and the SCSMPX extension from Kirk Munroe. Use it, extend it as you need it and let me know if you find it useful. I think i have put enough comments into the code so you can understand what each part does. If you have questions let me know.

[codesyntax lang=“powershell“]

[/codesyntax]

With best regards /Roman