Play with Speech Synthesizer using PowerShell and Node JS

This blog post is to demo the speech synthesizer using PowerShell. What’s new? Well nothing, except blending the PowerShell script with Node JS. To know about Speech Synthesizer refer MSDN – Reference for PowerShell is captured in idera PowerShell Tip (Speech-Week) Yes, this reminded a project I delivered for one of our Dutch customer!

Now, it’s time to click and convert text to speech! Let’s make it as simple as possible! The speech page is illustrated below!

PowerShell Script

Pretty straight forward! The script accepts a parameter $Text and we pass value from our node web application.


We have created two routes i.e GET and POST for ‘/Speech’ where the GET renders the speech.pug and POST calls the PowerShell script. Closer look to pass the value for the PowerShell parameter


Use your favorite bootstrap to make your web application glossy! See you all in my next blog post! Enjoy PowerShell!

Retrieve Oracle instance port number using PowerShell | REGEX

A requirement popped up to get the Oracle instance(s) port number before building a connection string for establishing a connection. Team used tnsping utility which returns results like shown below

We need to get the port number – Which is really a very straight forward approach using regular expression


Result : PORT = 15210


Play with PowerShell DateTime – Orchestrator Conditional Wait!

A colleague asked me a script to trigger an event on 5th business day from the date of submission.

Changing the script condition for management is hell! We need reminder in one business day, no well make it two! Hang on, keep it for 5 business day!

Here is the requirement! When user submit a request form it sends form details to third party orchestrator where the logical flow is built and codes are injected in palette for enacting the request. In a given requirement team should fire a reminder email on 5th business day! For example, today is 3/8/2018 adding 5 days to it give 3/13/2018 and excluding weekends i.e Saturday and Sunday it’s 3/15/2018 which is the 5th business day!

There are plenty of articles over internet which demonstrates the DateTime class in PowerShell. So, nothing new I can share expect this extension 🙂

Find next business for given day

In our case we need to find 5th business day but it’s business process right it may change often! Here is the sample code!

returns Wednesday, February 28, 2018 11:46:10 AM 

Parameterization – Just change as required!

Wednesday, February 28, 2018 11:54:33 AM


Indeed, many moved to SNOW (servicenow) and enjoying it where in few customers are still using legacy products! In my work place snow is in proof of concept stage. Like many automation enthusiast I love to explore both REST and SOAP for solving customer requirements. In this article I will walk you through the steps to consume HPSM soap web service and publish it as REST end points.

If you aren’t new to PowerShell then you must have come across the Hey Scripting Guy Post – Use PowerShell to retrieve a weather forecast!  Yes, nothing much I will explain here and in fact I follow the same foot-steps for our PowerShell script to work with HPSM SOAP Web Service.

To begin with let us explore the PowerShell script to query incidents by ID. Here the ID is valid HPSM incident ID which has a format like IM12345

Cool! It works and for now don’t worry about performance. We have plenty of ways to fine tune this code which will be covered in my next upcoming blogs!

Node Application

It’s time for us to build a node application and distribute the solution as REST endpoint in on premise server. Yes, the HPSM web service we used is cloud hosted application and managed by third party vendor(s).

Using the built in module ‘child-process’ we called PowerShell.exe and passed the script file path as argument. That’s it! Rest is our fruitful result!

Output is as shown below

Using Express Framework

In the preceding example we successfully got the output in the console. Now, we need to get this working in our web server. After a bit of trial and error I figured out the easier method!

Browse to http://localhost:3000 to see the result


If you observed the code carefully we used static value for the incident ID. So we need to tweak our code little bit! Just parameterize your PowerShell script as illustrated below

And your server.js will look like below

It’s really simple! Browse to http://localhost:3000/incidentid/IM12345 to see the same result 🙂

Deploy it as Windows Service

For this I used qckwinsvc.cmd which is really very handy. After installing the qckwinsvc from npm globally – Just use it

Now our service is up and running


Change BMC TrueSight Slot Values Using SOAP and PowerShell

BMC TrueSight – An Aerial View!!!

While working on Event Management a requirement popped up “Update TruSight the slot value when orchestrator automates the event(s)”. In short the automation agent should close the alert after auto-healing. I expected a REST endpoint but unfortunately SOAP web service was the only option.

To solve this we have to take five steps approach connect, map the mc_ueid, manipulate, update using SendEvent operation and disconnect. Yes, it’s that easy!

Establish the Connection

Map mc_ueid

Manipulate status

Update Using SendEvent

Disconnect (Do bulk operation and call disconnect)

Enjoy PowerShell 🙂

Play with node-powershell!


One of my colleague asked me a PowerShell script to query AD User information! Yes, I did your voice!

But, he asked “How will I do it in NODE JS with no AD Module?” Well! it’s too deep to discuss about node js! Anyways to make it simple I shared an app which  serves as a REST endpoint to query AD User information from any platforms like ASP.NET , NODE JS, PowerShell etc.


The PS script for User.PS1 is using ADSI 🙂 with a parameter for samaccountname which is named as GUID (A Friendly Name 🙂 )!

Spin your NODE and browse for the result!  REST URL :

The RESTful continues! Happy PowerShell!

Create a HPSM9 incident with an attachment using PowerShell


One of our valuable customer asked a script to create a HPSM9 incident with a screen shot! Yes, it is really easy if we understand the WSDL! With no wait here is the snippet

The documentation for HPSM9 is here! Get the full script from GitHub!


Part 2: Customize SharePoint Online User Interface using JavaScript | CSOM | PowerShell


This is a continuation of part 1 and we will cover about adding a custom action in site action of the web. Note: You can think about any solution. This blog post is to show an option in PowerShell and Client Side Object Model to customize the Site Actions of the web.

  1. To know Default Custom Action and Location ID’s – Navigate here.
  2. How to work with User Custom Action – Navigate here.

Here is the sample code to add a link in Site Actions!

Site Actions Before


Site Actions After


Full Code

Enjoy PowerShell!

Get High Priority Email Message as a Phone Call using EWS API and PowerShell


A colleague shared a blog post and asked me a script to get high priority email using PowerShell? Well, it’s the same way  by modifying the search filter as required as shown below.

and the below is the view to get the number of email we need from the inbox – In our case just one!

Hey, I need a phone call for a high priority email and it should read the message! That’s a Friday fever! For any IT Professional major incidents are not new 🙂 check the below email body 🙂 let’s get a call for the same !

Email Body



Here is the sample code !

Enjoy PowerShell!

Microsoft Word VSTO ADDIN – Retrieve SharePoint Site List Information Using CSOM

A friend of mine Erdem Avni Avni SELÇUK from Turkey showed a video sample which retrieves SharePoint Online list column information in Excel! Truly amazing stuff for SharePoint IT Professionals  at least for me. So, thought of Sharing my demo code which simply lists all SharePoint list title and includes a header text and footer with image in word document. This is very ugly code but may give some dice for IT Pro’s for customizing and building the solution as desired for content managers.

This is our output – Modified the image so header and footer will be visible



Step 1: Create a a Office VSTO office 2013 / 2016 addin solution using Visual Studio – Start From here

Step 2: Add a new item to the solution and choose Ribbon – it’s an xml file! – Start From here

Step 3: Install CSOM SDK assemblies 🙂 🙂 🙂 – Below is the sample code

Continue reading Microsoft Word VSTO ADDIN – Retrieve SharePoint Site List Information Using CSOM