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




Thursday, November 28, 2013

MTUG: Presents Travis Wright - Automating datacenters and client management

 
Cireson is in Town and we got Travis Wright to hold a Session for MTUG OSLO.
This is going to be a great session on the following topics:
  • System Center Service Manager
  • Orchestrator (SMA)
  • Powershell
  • Azure
Join this session free session @ http://www.meetup.com/MTUG-System-Center/events/150733802/
 

Wednesday, November 27, 2013

Orchestrator: Problems with access to the Orchestrator Console after SP1 Upgrade?

Well..  Orchestrator SP1 has been around the block for a while now and I came across a weird thing the other day.

The customer had a problem with the Orchestrator console in their Runbook environment and  got this message when trying to access the web console remote.









So I logged on to the Webservice Server (locally) and tested again..


 













Still no go...

It seemed like I did not have access to the directories. So I opened the IIS console and selected the
"Microsoft system center 2012 Orchetsrator Web service" site and selected [basic settings].
In the "Edit Site" I tested the settings to check that the results was valid.



The Test Connection failed on the Authorization, and saying that the account used could not access the installation directory. (Strange because my installation account has full permissions on the path).

Back in the edit Site again I could see that the "Microsoft system center 2012 Orchestrator Web service" site was linked to the DefaultAppPool and not the system Center Orchestrator Web Feature pool. (installed during installation).
















So I changed it back to the right Application Pool and did the test.




 
















Now the result was valid for both the tests.

On a remote computer I opened up the Orchestrator Web Console and it worked perfect again.











 

Monday, November 25, 2013

Orchestrator: Search for Text in a textfile with Regluar Expressions

Well I had a case the other day where I need to search for a username in a textfile and add the username as affected user in Service Manager. So I started to work on my plan on how to make this dynamic and bulletproof.

Here is a snip of the textfile:












The line that I am looking for is "Affected User: u2121" and my goal is to get only the u2121 id everytime the activity is run in different text files.

So how can I do this? Well then I remembered Regular expressions. What did Technet say on that subject again?

Regular expressions let you match a string to a pattern. The regular expression can contain a number of different elements that define the pattern. 

Hmm... Pattern.. Interesting..  I know that all ID here start with a U and a chain of number like
 u2121,u3434,u1414,u3535 and so on... So regular expressions it is

Affected user: u2121 was the text in the textfile. If the ID would have the following pattern in every textfile searched we can use a regular expression.

 In the Search text I added u[1-9]+ and selected "Use regular expressions".













Then I did a test, and the matched text showed the ID in the textfile, Nice!.










So let's look at the text I searched for again. Well all ID started with a u then that would be my first search query. (Simple ;)

Then I know that the rest is numbers between 1-9. So I added [1-9] which means all between 1 and 9.

But the number of characters on the ID's was sometimes 4,5,6. so I added the + to the end to match all of them. Now it will find the ID either it is with 4,5,6 characters.

This was a quick intro in this and there are plenty of combinations to use. Check it out!

http://technet.microsoft.com/en-us/library/hh440535.aspx

Wednesday, October 23, 2013