The new preview of System Center Orchestrator 2012 R2, comes with a new part called “System Management Automation”
Not much info has been released about what it is, or what it can be used for.
update: more information have been released by microsoft. Start here
It seems to me to be a new runbook engine, with a completely new type of runbooks. I can’t wait to get more info about what it is , and what it is for.
It has 3 parts which is installed seperately:
- Web Service
- Runbook Worker
- PowerShell Module
I will try to post some of my exploration of this new part of Orchestrator.
This will be a series of blog articles.
So far these have been planned:
SCO 2012 R2: System Management Automation Part 1 – Overview and Setup
SCO 2012 R2: System Management Automation Part 2 – The PowerShell Module
SCO 2012 R2: System Management Automation Part 3 – The Web Service
SCO 2012 R2: System Management Automation Part 4 – Using the Web Service in Visual Studio 2012
In this article i’ll show how to use the PowerShell Module.
The idea is to give you a chance to play around with it, and any kind of comments/feedback is very welcomed!
Lets go!
Start by Installing the PowerShell Module on your lab machine, i have installed all parts of SCO R2 on the same lab server.
All PowerShell cmdlets need a web service URL and port to work in this article i will use splatting to make it easier
Import Module
import-module Microsoft.SystemCenter.ServiceManagementAutomation
Get Commands in module
get-command -module Microsoft.SystemCenter.ServiceManagementAutomation
Get SMA Runbooks using standard parameters
Get-SmaRunbook -WebServiceEndpoint "https://scor2.cloud.local" -Port 9090
Get SMA Runbooks using splatting
$connection = @{"WebServiceEndpoint"="https://scor2.cloud.local";"Port"=9090} Get-SmaRunbook @connection
When using these cmdlets, splatting is very usefull. Splatting enables you to define some parameters once, but use it in multiple commands.
This technique will be used for the rest of the commands.
Start SMA Runbook using ID
$connection = @{"WebServiceEndpoint"="https://scor2.cloud.local";"Port"=9090} $runbookID = "9a3d0067-1cc0-4812-9653-57103a5cae5e" Start-SmaRunbook @connection -RunbookId $runbookID
Start SMA Runbook using Name
$connection = @{"WebServiceEndpoint"="https://scor2.cloud.local";"Port"=9090} Get-SmaRunbook @connection -RunbookName "My SMA Runbook" | Start-SmaRunbook @connection
Get SMA Runbook Worker Deployments
$connection = @{"WebServiceEndpoint"="https://scor2.cloud.local";"Port"=9090} Get-SmaRunbookWorkerDeployment @connection
Get SMA Jobs
$connection = @{"WebServiceEndpoint"="https://scor2.cloud.local";"Port"=9090} Get-SmaJob @connection
Other Cmdlets included in module:
These is a lot of cmdlets included in the module, please do not ask me what they are for, since i don’t know yet!
but if you dicover anything, feel very free to share it in comments or email!
Almost all cmdlets use the same technique and need the webservice url and port
$connection = @{"WebServiceEndpoint"="https://scor2.cloud.local";"Port"=9090} Get-SmaRunbookWorkerDeployment @connection Get-SmaJob @connection #and so on....
Edit-SmaRunbook
Get-SmaAdminConfiguration
Get-SmaCertificate
Get-SmaConnection
Get-SmaConnectionField
Get-SmaConnectionType
Get-SmaCredential
Get-SmaJob
Get-SmaJobOutput
Get-SmaModule
Get-SmaRunbook
Get-SmaRunbookWorkerDeployment
Get-SmaSchedule
Get-SmaVariable
Import-SmaModule
Import-SmaRunbook
New-SmaConnection
New-SmaRunbookWorkerDeployment
Publish-SmaRunbook
Remove-SmaCertificate
Remove-SmaConnection
Remove-SmaCredential
Remove-SmaModule
Remove-SmaRunbook
Remove-SmaSchedule
Remove-SmaVariable
Resume-SmaJob
Set-SmaAdminConfiguration
Set-SmaCertificate
Set-SmaConnectionFieldValue
Set-SmaCredential
Set-SmaSchedule
Set-SmaVariable
Start-SmaRunbook
Stop-SmaJob
Suspend-SmaJob
Have fun! I am personally looking very much forward to dicovering more about SMA!