次の方法で共有


Service Manager portable module for SMA/Azure Automation

UPDATE: Since writing this, the PowerShell gallery is available at https://www.powershellgallery.com. There's a great SCSM module, which you can deploy directly to Azure Automation @ https://www.powershellgallery.com/packages/ScsmPx.

If you're using SMA, you've probably noticed there are many modules imported for you out-of-the-box. Among others, this includes modules for some of the System Center components: Configuration Manager, Data Protection Manager, Operations Manager, Virtual Machine Manager & SPF.

However, in SMA, there is no module for Service Manager by default. This isn't a big deal, as your PowerShell workflows can still run Service Manager cmdlets, as long as you install the Service Manager console (which includes the PowerShell module) on the Runbook Worker.

The benefit of having the PowerShell module imported into SMA or Azure Automation as an asset is simple – the Service Manager cmdlets are shown alongside all of the other activities in the UI. The module is used only to make the authoring experience easier, giving benefits such as storing a Service Manager credential as an asset in SMA or Azure Automation.

One thing to note – this is NOT the whole Service Manager PowerShell module, but the portable module. This basically means that we define what cmdlets are available in the module & store credentials, but don't actually copy any of the resources over. Remember, this is just used to show the activities in the authoring experience. There's more information about Portable Modules at https://blogs.technet.com/b/orchestrator/archive/2013/11/04/service-management-automation-portable-modules-what-why-and-how.aspx.

I created the portable module, using the New-SmaPortableModule command, which is part of the SMA PowerShell module. I've attached it to this blog post, so you can simply import it, rather than having to roll your own. This was created in a Service Manager 2012 R2 UR5 environment.

 

Importing the Module in SMA

To import the Service Manager Module via the Azure Pack site, go to Automation > Assets > Import Module. You can simply upload the .zip file attached to this blog.

 

Importing the Module in Azure Automation

From the Azure Automation blade, you can go to Assets > Modules > Add a Module. Upload the zip file attached to this blog.

 

The module takes several minutes to be extracted and imported. After a few minutes, you'll see the Service Manager activities available to use in your Runbooks.

System.Center.Service.Manager-Portable.zip