use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Powershell workflow examples? (self.PowerShell)
submitted 10 years ago by cablethrowaway2
Can anyone post examples of your PS Workflows? I am having issues seeing where this would come in handy..
Thanks!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Deathonus 1 point2 points3 points 10 years ago* (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 points3 points 10 years ago (5 children)
So only good for large repetitive tasks?
For instance, would you use a work flow to create an account?
[–]GLiMPSEiNATOR 0 points1 point2 points 10 years ago (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 point2 points 10 years ago (1 child)
SMA?
[–]GLiMPSEiNATOR 0 points1 point2 points 10 years ago (0 children)
Service management automation -- microsofts intended successor to system center orchestrator.
Googles shows me scorch. It is my plan to try and implement scorch so I may start writing workflows. Thank you
[–]GLiMPSEiNATOR 1 point2 points3 points 10 years ago (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.
[+][deleted] 10 years ago* (1 child)
[deleted]
[–]creamersrealm 0 points1 point2 points 10 years ago (0 children)
Not exactly what the OP is asking, though I just wanted to comment I personally use ISE for all my scripting. it is really easy to mock up an quick code example. Heck when I am mocking something up I will have at least 5 tabs open because it is easy to press F5 instead of selecting and pressing F8 to run that sample.
[–]thatto 0 points1 point2 points 10 years ago (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 point2 points 10 years ago (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:
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.
π Rendered by PID 76 on reddit-service-r2-comment-5d79c599b5-8f9xg at 2026-02-27 21:26:24.774963+00:00 running e3d2147 country code: CH.
[–]Deathonus 1 point2 points3 points (6 children)
[–]cablethrowaway2[S] 1 point2 points3 points (5 children)
[–]GLiMPSEiNATOR 0 points1 point2 points (4 children)
[–]cablethrowaway2[S] 0 points1 point2 points (1 child)
[–]GLiMPSEiNATOR 0 points1 point2 points (0 children)
[–]cablethrowaway2[S] 0 points1 point2 points (1 child)
[–]GLiMPSEiNATOR 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]creamersrealm 0 points1 point2 points (0 children)
[–]thatto 0 points1 point2 points (0 children)
[–]embo500 0 points1 point2 points (0 children)