Monday, August 18, 2014

Blogg has been moved to Knallert.NO

Hi everyone!!

New blogposts will be created on the new Knallert.no site


Hope I see you there!

Thursday, February 27, 2014

Orchestrator: Find user from SMTP address SCSM

Hi after a couple of weeks of we are back again with posts for 2014! So I will start with a little nice PSscript to have in you PS repository.

In a case I worked on for a couple of weeks ago, I needed to look up the SMTP address of a CI in SCSM, in an Orchestrator Runbook.

To do this I used a PowerShell Remote script to do the job in a runbook.

Here is the script:
$session = New-PSSession -ComputerName SERVERNAME
    Invoke-Command -Session $session -ScriptBlock {
       
        Import-Module smlets
        $Userdisplayname = "USERDISPLAYNAME"
        $userpreferenceclass = Get-SCSMRelationshipClass -name system.userhaspreference
        $class2 = get-scsmclass -name system.user$
        $user = Get-SCSMObject -class $class2 -filter ”Displayname -eq $Userdisplayname”
        $mail = (Get-scsmrelatedobject –smobject $user –relationship $userpreferenceclass | where{$_.displayname –match “smtp”}).targetaddress
            
    }
    $mail = Invoke-Command -Session $session -ScriptBlock { $mail }



Remove-PSSession $Session

Here you need to change the SERVERNAME and USERDISPLAYNAME, with  the SCSM server and the displayname of the CI.

The result of the script will be available in the $mail variable.

Then I added the script to a Run.Net Script Activity.

The $mail variable now contains the SMTP address of the CI Object.

In order to publish the result to the next Activity in the runbook do the following:

Open the Run.Net Script Activity and Select [Publish Data] then click [Add].

Type a name, type and the variable name from the PS script. Click [OK]
 
The variable is now available in the bus, and can be used in other activities in the runbook.
 





Thursday, January 23, 2014

Orchestrator: NIC 2014

On the 16 January, the NIC2014 convention was the place to be. http://nicconf.com


I had a session there with the topic "10 ways to trigger Runbooks" in Orchestrator. The agenda was to show that Orchestrator has many options when it comes to trigger runbooks and creating an automated environment.

If you are interested in viewing the presentation it is available on slideshare.com: 10 ways to trigger runbooks