Automate!

Austrian Blog around optimizing datacenters with Powershell and Azure

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

[/codesyntax]

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:

Import-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.

R.

Links:

https://kirkmunro.github.io/ScsmPx/

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

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:

SRPrintOutput

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.

SRHTMLTemplate

 3.) Save as „Website -filtered“

Saveasfiltered

 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:

HTMLInPowershell

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 Microsoft.windows.Computer$
$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.

„ComputerName“,“SerialNumber“,“OSName“,“Manufacturer“,“Model“
„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.

Location-Assets

==> 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.

SAPProvanceExampleScrSh

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 http://gallery.technet.microsoft.com/Orchestrator-Integration-438f9ece
  • good process definitions because automation needs a high level of standardization

Technical Implementation

1.) Installation of the Provance Support Modules

Contact support@provance.com 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.

Execute_PSScript

The Powershell execution activity needs to be configured that way.

ProvanceDMPProperties

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 ImportTemplatesandFiles.zip

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

ProvanceSAPFiles

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.

HWCB-Screenshot

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 !

Roman

Link to video#1

Link to video#2

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

ManagementPacks

ReportDefinition

 

Provance DMP: Import Hardware Assets and link them to a Warranty Contract

No Comments »

Hi All !

The value of Asset Management products should be more than a status of single assets, and thats where agreements and contracts come into the game.

So when your company has Provance ITAM and DMP in place this video shows how you can import Hardware Assets, link them to Models and to a warranty Agreement by creating warranty contracts.

The files are attached below, have fun watching and trying.

http://youtu.be/80uBQ2zPlR0

Hardware-linked-to-warranty

Roman

System Center Service Manager 2012 R2 – Installation and whats new

No Comments »

Hi All !

Just after the release of the preview, I couldn’t wait to download the newest version from TechNet and install it in my demo environement.

SCSM2012R2InstallScreen

During the download I tried to figure out what improvements are taken to make the customers and consultants life easier.

  • Will there be a harmonized concept for Primary Owner/Assigned to ?
  • Maybe Quick-Templates as part of the product ?
  • Any news about advanced view editing
  • more functionality in creating criteria for workflows ?

After the installation was finished, I opened the console and watched out for new entries, form changes, views and find – nothing new ???

Ok back to RTFM I started to read the “System Center R2 Overview White Paper”. In the Service Manager Section it says:

  1. Support for Sharepoint 2013 to run the SSP.
  2. Additionally in the System Center Library – Installation guide,  the support for Windows Server 2012 R2 is mentioned

http://technet.microsoft.com/library/dn299380.aspx

All the other stuff like the Cloud Process Pack, processes and things we know already are – as it seems – still the same.

So, my advse – if you dont plan to run SCSM on Windows 2012 Server R2 Server or Sharepoint 2013 its currently not worth the effort to evaluate.

Hopefully Microsoft will come out with some more features in R2 Betas and RTM.

Greetings / Roman

Provance ITAM Demo #3: Data Import possibilities with the provance Data Management pack

No Comments »

Hi All !

This video shows a bunch of options, how to import data into Service Manager with the Provance Data Management Pack (DMP)

  • It covers creation of assets,
  • update of assets
  • the creation of hierarchies and the
  • import via PowerShell

Check this out at http://youtu.be/q8Bqu2XdDo8

Files to experiment at your site can be found here. DMP-Demo

Have fun watching and building !

R.