Tweet from PowerShell... Customized for a TS

Ok.. another one that's been in my drafts for the past 3 months, Seems to work fine, however if you run it in a TS over and over and over again because you're testing constantly, it seems to skip some, like Twitter blocks duplicate Tweets. Anyway, here ya go.  If you have any improvements, please get ahold of me.


Hey Folks, so I am at MMS right now, and I saw a lot of demos were people were tweeting from at Task Sequence using Orchestrator. I was like, um.. that seems like a lot of work to just tweet, I don't want to support another server, hopefully it's actually doing more than just tweeting. I set this up a while back for fun, and forgot to blog it, so here it goes. The hardest part... was already done by Adam! I stole his work, and built on top of it. You've probably noticed that is a theme on my blog, I like to borrow the hard work of other and twist it for my own purposes, of course giving credit where credit is due. I hope you are doing the same to my blog, and please give me a shout out if you take something I've done and add to it, and then blog it for everyone else to use!
So I started here, Adam's  Blog.  This provided the connections to Twitter.  I created a new account specifically for my blog (@garytownblog) and set it up in his script, which he explains in great detail.  So Part 1 ... Go there and do that..

Part 2... the half that makes it work nicely in a Task  Sequence.

It requires several variables, but if you use my  Task  Sequence that you can download from HERE, (MMS2018) then you can just plop it in.
Otherwise, you'll need to make sure your TS has  (talked about more here)

"SetOSDInfoOType", (Either IPU or  CS or  OSD)
"osbuildversion", which will be the build number you set in your  TS.  It uses these to create a hand crafted tweet with additional info.  You can always remove these and have a generic tweet message for each time you run it, or add to it.   Pretty flexible.

Once you have your script, and you add it to your content, you can then add it to your  TS.
Run  PowerShell Script Step -> point at your script, add users you want to tag  (If you want to), and you're set.


1 thought on “Tweet from PowerShell... Customized for a TS”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.