Austrian Blog around optimizing datacenters with Powershell and Azure

Blog relaunch 2017

No Comments »

Hallo Alle!

Trotzdem dieser Blog jetzt einige Zeit offline war wurde er Anfang Juli 2017 auf eine neue Plattform verschoben.

Jetzt mit HTTPS verschlüsselt dürft ihr euch auf Erfahrungen mit Azure, PowerShell, Monitoring und Security freuen.

Bis bald / Roman Stadlmair

PowerShell your ServiceManager & ITAM: Get Hardware Maintenance Expiry Information

No Comments »

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.


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“]


With best regards /Roman


PowerShell your ServiceManager & ITAM: Get Discovered Computer Information

No Comments »

Hi all !

Lets focus on a simple problem, many Service Manager / ITAM customers probably have. A set of discovered computers by AD/SCCM is imported into the ServiceManager CMDB with more or less useful information. On the other hand there is unstructured ITAM data. So what those many people want is:

Create an Asset for every Computer CI in the CMDB !

Even if this is not best ITAM practice, it is a common question/demand, this blog addresses

The solution can be easily done with the ScsmPX Module on GitHub and a little piece of code. In the files available in the download section you will find the Powershell Script, and the Provance Import Template to allow the creation of Assets with Provance DMP.

[codesyntax lang=“powershell“ lines=“normal“ container=“pre“]


The Import Template uses this CSV and loads the Data as Assets, depending on if its physical Computers or virtual machines. Below find a screenshot of the template:


Screenshot of the Import Template (Provance Data Management)

Finally if you load the data with the Provance DMP you get:

  • Physical Hardware Assets + Assigned User
  • Hardware Catalog Items for Physical Computers + related Vendor
  • Virtual Computer Assets + Assigned Users
  • All assets are linked to CI´s

Way to go and start importing/editing financial data for your assets

Update: Sept 2015: Script now uses Powershell v3 PSObject way of creating arrays

Cheers / Roman

Script and Import Template

PowerShell your ServiceManager & ITAM: Intro

No Comments »

Dear All !

Service Manager has a wide range of customers and many people deploy or use it in operations. All those know that Service Manager needs customization and sometimes also development to fulfill the needs of IT organizations.

This blog is the starting point of a series to manage Service Manager with Powershell.

BORING you might be forced to say – but wait – this series differs from all those tons of other blogs out in the wild by a couple of facts i will explain now.

  1. No SMLets – SMLets are still in Beta and the future is unclear
  2. Leverage ScsmPX Modules. Kirk Munroes´s (the Poshoholic :-))  ScsmPX Module is Open Source, is based on Microsofts SCSM-native Modules and extends them with the functions that are missing.
  3. No SMA, Orchestrator, or other SC products just native PowerShell. We know you can call anything from anywhere so automation is  limitless (SMA,SCOR,SCSM, …) but we want to focus on the basics.
  4. Examples will be based on Service Manager and Provance 2014 ITAM, from what i saw in the field but the examples are open so you will be able to adapt them to your needs.

The first entry will be posted soon, so stay tuned.



Update #1: I have attached a screenshot sample in PDF of „How to runa powershell script with parameters with task manager“ because the exampled following are based on that and so you have a easy reference for configuring Task Scheduler.

Run a Powershell Script with Paramaters with task Scheduler

Provance announces „The Suite“

No Comments »

Hi All !

2 days ago Provance announced a bundle of software products for
System Center Service Manager. Included will be i.e.

  • Syliances Portal
  • Gridpro´s Web Console
  • Expits Analytics

and a bunch of other stuff, making Service Manager customers life easier.

More info at the or the original press release

Cheers / Roman


SCSM: Print Service Request Task

No Comments »

Hi All !

Ever tried to print a WorkItem ? Well i recommend – dont do that – because
what you get is a print of all properties from all tabs, without the selection method
to limit the outcome which might lead to a 6 or more page print.

A customer asked for a possibility to print selective data from a Service Request on one
because page because sometimes the field support has to have something printed.

The solution below consists of a PowerShell script which collects the infomation you want
and prints this within a nice HTML-based layout of your choice.

An output might look like this:


All you need is:

  • The standard SCSM commandlets installed with the SCSM-Console
  • Winword or your favorite HTML-Editor
  • The Powershell script attached.
  • A new task in SCSM

So how does it work ?

1.) Select which properties you want to show in the HTML Form.

This might be the Title, ID, Status and so on. The properties must be written inside
the HTML-form as placeholders for the data.

Furthermore, the properties must be placed into variables in the Powershell script

 2.) Generate the HTML-Template

Open Winword, design your page with tables, fonts, … and place the variables inside
the template as shown in the screenshot below.


 3.) Save as „Website -filtered“


 4.) Paste the HTML Code in the Powershell script

In the Powershell Schript SRPrint.ps1 you find a section called:

$header = @“PLACE FOR HTML CODE„@

Replace the grey text with the HTML Code from the Winword file which will look like this:


5.) Create a task

In Service Manager – Library – Create a Task with no categories and the following parameters

The Powershell-script of the task needs one parameter -SRIdent which is the SR-ID. This
parameter is then handed over by SCSM to identify the Service Request.

Many thanks to Christian Graf from Asterios Design which lead me to the right direction on
howto call HTML from Powershell.

See the Powershell Script here.

Cheers / Roman

Create CSV out of Powershell Data

No Comments »

Hi All !

Recently i had the situation, where there was no SCCM Agent in an environement for specific
reasons, but the customer wanted to use this data to fill up his SCSM Database (Provance Assets in that case). So we had more ore less empty CI´s in the SCSM Database and wanted to fill this up with directly scanned WMI Data.

The result should have a format to be directly used by an SCSM Import Tool.

The Powershell Script queries all Virtual machines in the SCSM Database and gets information from online machines via WMI. This data is then written to a CSV File. Use and have fun.

 # Script to query Online Virtual Machines based on SCSM Data to get Serial Numbers
import-module smlets
$Computers = Get-SCSMCLass$
$VMList = @(Get-SCSMObject $Computers -Filter „IsVirtualMachine -eq ‚true'“)
$Arr = @()
foreach ($VM in $VMList)
        $data = new-object psobject # New Object
        $data | add-member -membertype NoteProperty -Name ComputerName -Value $VM.NetBiosComputerName
        $data | add-Member -membertype NoteProperty -Name SerialNumber -Value (Get-WMIObject -Class „Win32_BIOS“ -Computername $VM.NetBiosComputerName).SerialNumber
        $data | add-Member -membertype NoteProperty -Name OSName -Value (Get-WMIObject -Class „Win32_OperatingSystem“ -Computername $VM.NetBiosComputerName).Caption
        $data | add-Member -membertype NoteProperty -Name Manufacturer -Value (Get-WMIObject -Class „Win32_ComputerSystem“ -Computername $VM.NetBiosComputerName).Manufacturer
        $data | add-Member -membertype NoteProperty -Name Model -Value (Get-WMIObject -Class „Win32_ComputerSystem“ -Computername $VM.NetBiosComputerName).Model
        $Arr += $data
$arr | select -property ComputerName,SerialNumber,OSName,Manufacturer,Model | export-csv -notypeinformation .\Documents\VMSerials.csv
Remove-Module Smlets

The result is a CSV file like this.

„Server1″,“1111-1111-1111-5431-2407-9700-21″,“Microsoft Windows Server 2012 R2 Standard“,“Microsoft Corporation“,“Virtual Machine“
„Server2″,“2222-2222-2222-7060-4845-5504-27″,“Microsoft Windows Server 2012 R2 Standard“,“Microsoft Corporation“,“Virtual Machine“
„Serern“,“3333-3333-3333-9977-7669-1954-03″,“Microsoft Windows Server 2012 R2 Standard“,“Microsoft Corporation“,“Virtual Machine“

Regards / Roman


Map Assets to locations with on-board facilities

No Comments »

Dear All !

Recently a customer asked me if it is possible to map assets to locations based on their IP address.
Even if this is more of a configuration management issue than asset management, i wanted to know
how easy that is with on-board functionality of Service Manager, Provance and Orchestrator.

See the results in the video which contains the scenario, the demo and the explanation of the solution.


==> YOUTUBE VIDEO ==> Click on the Link for the video.

If you want to try the solution – please see the attached files here IP2LocationMapping
They contain the slideshow, the class extension -XML and the Orchestrator runbook.

Cheers / Roman

Provance ITAM Integration with SAP

No Comments »

Hi all !

A question / demand of customers which comes very often is how to integrate Asset Management with ERP. In this demo
i am going to show you how this can be done with the help of SystemCenter Tools and Provance Software.


You will first see a Powerpoint with the scenarios i created for the demo and then the actual implementation.

==> YOUTUBE VIDEO ==> Click on the Link for the video.

What you need to implement this is:

  • System Center Service Manager 2012 SP1
  • System Center Orchestrator 2012 SP1
  • Provance Asset management Pack
  • Provance Data Management Pack
  • Provance Support Powershell Module (Ask Provance)
  • Orchestrator Powershell Integration Pack 1.2
  • good process definitions because automation needs a high level of standardization

Technical Implementation

1.) Installation of the Provance Support Modules

Contact to get the the latest support-modules. This are 2 Files, ProvanceSupport and ScsmLoader.
Extract them to a folder within the PSModulePath Environement Variable.
A Powershell session should (if correctly installed) allow you to load

After that the „Import-ProvanceData“ command should be available.

2.) Preperation of the first SCSM Management Server (Workflow Server)

On the Workflow Server there has to be one account which is allowed to import DMP Data, this account will be used by the
remote Powershell Session to start the DMP Import. So before playing around with Orchestrator log in with that account
and try to import data with the DMP via Powershell.

The account you are using must have started the SCSM Console successfully once, bcs. the import-provancedata command
uses the registry entries to connect to the manegement server.

 3.) Preperation of Orchestrator.

Have Orchestrator 2012 SP1 (i am running R2) installed, the Service Manager 2012 OIP installed and configured
and the Powershell Extension 1.2 installed and configured.


The Powershell execution activity needs to be configured that way.


Enter a the Workflow Server as the hostname, domain, username and password of the account you have been
configuring for the DMP Import.

The command in „PS Script 01“ is:

All the other technical implementation details are shown in the video. Attached to this BlogEntry you find:

  1. Runbook example on how to start DMP Import from Orchestrator (DMPImportExample.ois_export)
  2. Runbook example for a purchase order export (WritePOFile.ois_export)
  3. DMP Templates and example files

I hope you have found that useful, if you have questions, at the very beginning of the video you find my E-Mail Adress.

Best regards / Roman


Provance Chargeback Solution with 11 kb of Code – Part #1

No Comments »

Hi All !

In many discussions with Provance partners and customers, there is always the question for charging the customers for IT Services/Products/Assets.
Therefor i have put together this video and the according files and links to make this real for everybody and get reports like the one below.


There are 2 videos, the first one will show the solution design and the perspective of the ITAM-Manager, the second part, shows the technical side with Management Packs, Data Warehouse and SSRS Configuration.

Have fun !


Link to video#1

Link to video#2

Below you will find the needed files to implement the solution.