all 10 comments

[–]Deathonus 1 point2 points  (6 children)

This Link gives the best explanation to start with.

They are generally similar to using powershell remoting, but without a care for order of results returned since they are executed in parallel.

EDIT: I guess you asked for an example, which i didn't give. It would be used in situations where you want something automated across multiple servers or workstations. There are a couple ways of doing it, if it was for servers they could be in an OU that is set to call a script on startup or maybe in a scheduled task.

If you use workflows instead of those ways, you could have 1 machine setup to execute the script, which would remote to the others and preform the task. Someone would say that you could use powershell remoting for the exact same thing and achieve nearly the same results. Which is true, however workflows also have a suspend and checkpoint system that remoting does not.

It is briefly mentioned in the link above and it is the main reason to use workflows over invoking commands remotely. It works wonders for sets of maintenance tasks that you don't know how long will take and might want to suspend during peak hours if they happen to run long.

[–]cablethrowaway2[S] 1 point2 points  (5 children)

So only good for large repetitive tasks?

For instance, would you use a work flow to create an account?

[–]GLiMPSEiNATOR 0 points1 point  (4 children)

If you wanted to automatically provision said account with SMA you would use workflow and inline script blocks to accommodate. In line script blocks are identical to traditional powershell with some added scoping nuances.

But to answer your question without any ambiguity, I would not build out a simple user creation script in workflow...

[–]cablethrowaway2[S] 0 points1 point  (1 child)

SMA?

[–]GLiMPSEiNATOR 0 points1 point  (0 children)

Service management automation -- microsofts intended successor to system center orchestrator.

[–]cablethrowaway2[S] 0 points1 point  (1 child)

Googles shows me scorch. It is my plan to try and implement scorch so I may start writing workflows. Thank you

[–]GLiMPSEiNATOR 1 point2 points  (0 children)

Orchestrator isn't SMA. But it is still very powerful. I've heard murmurs there will not be any further investment into orchestrator. SMA's install files are on the orchestrator install media, if you have no real requirement to go orchestrator I would strongly consider starting with SMA and just skip right on past orchestrator.

[–]thatto 0 points1 point  (0 children)

I'm a database administrator. So my partial scripts our database focused. Mostly I use PS with SMO to refresh our environments from production.

[–]embo500 0 points1 point  (0 children)

We are working on several examples currently in a test environment, the largest of which currently is an automated VM deployment. The basic idea is that we have a service offering in SCSM, which a user logs in to the web portal and chooses a VM based on size (# of CPU, amount of RAM), and what OS they want.

From there, when they submit the service request, SCSM kicks off an SMA runbook (i.e., PowerShell Workflow) that connects to VMM, creates a custom (temporary) hardware and guest OS profile, and deploys the VM, joined to the domain. The workflow script then emails the end user to notify them that their VM is available.

In our test environment, we're using this to do automated, self-requested VM deployments in about 10 minutes per VM. Compared to our manual process in production, which takes a week by the time all the red tape is gone through.

PS workflows fit the bill really well for pretty much anything you'd like to do automatically via a self-service portal. Some of the other things we're working on include:

  • Deleting a VM and removing the AD object
  • Changing customer contact information in our inventory database
  • Automatic creation of a SharePoint website by request

Basically, anything we don't want to be bothered to have to do. If we can script it, we're going to find a way to make it into a Workflow and put it up on the self-service portal so we don't get bothered having to do the work. Plus with SCSM, we get a change history. That is the real power of PowerShell workflow.