Powershell activity - hostname issue

tiyasa
Giga Expert

Hello,

I am an absolute newbie at orchestration but I am trying to learn how to use PowerShell for orchestrating. I have read and tried some fabulous articles which have been very helpful in preparing a base.

I am trying to run a simple PowerShell script. The problem arises because my workflow picks the default mid server value even if I specify a hostname through input variables through custom PowerShell activity and setting it to Target Host with no luck.

I tried to remove the default value to blank in the mid server properties but that results in Error: The MID Server (null) is not valid.

Any suggestions on how to get it working?

Thanks

~T

1 ACCEPTED SOLUTION

Hi Tiyasa,



You do not have to make changes with IP address in credential table. IP range based MID Server Configuration will be set up based on the below URL.



https://docs.servicenow.com/bundle/helsinki-it-operations-management/page/product/mid-server/task/t_...



Below are the two scenarios



  1. 1)           Manual Update: Here we will change the default MID Server manually.
  2. 2)           IP Ranges based: Here we will define IP Ranges for each MID Server. For an example MID Server A, the IP range is 10.10.10.1/24 and MID Server B, the IP range is 192.168.0.1/24. Suppose here we select the default MID Server as A and our Domain server IP is 192.168.0.50. In this scenario when we extend the account from ServiceNow, the workflow automatically pick MID Server B. Because we have specified IP Ranges for each MID Server so it will override the default MID Server use.


Regards,


Vivek


View solution in original post

8 REPLIES 8

Vivek,



Thank you. It makes sense but like I said since I am a newbie some more information will be helpful.


For example, I am trying to follow your instructions and did the following:



- went into Orchestration-> Credentials and created an entry with the mid server details and IP.


- In the workflow, I pass in the IP address.


- Default mid server is still set to empty



Result - still get the error.



What am I missing?


Hi Tiyasa,



You do not have to make changes with IP address in credential table. IP range based MID Server Configuration will be set up based on the below URL.



https://docs.servicenow.com/bundle/helsinki-it-operations-management/page/product/mid-server/task/t_...



Below are the two scenarios



  1. 1)           Manual Update: Here we will change the default MID Server manually.
  2. 2)           IP Ranges based: Here we will define IP Ranges for each MID Server. For an example MID Server A, the IP range is 10.10.10.1/24 and MID Server B, the IP range is 192.168.0.1/24. Suppose here we select the default MID Server as A and our Domain server IP is 192.168.0.50. In this scenario when we extend the account from ServiceNow, the workflow automatically pick MID Server B. Because we have specified IP Ranges for each MID Server so it will override the default MID Server use.


Regards,


Vivek


I see. I have mid server installed on my local and connected to my Personal Dev Instance. I followed the steps and now it does run for me. Although the outputs are returned as null, I can debug that now.



Thank you for the suggestions and inputs, Vivek. Appreciate it.


Hi Vivek,

 

I have a MID server which is up running and it is defined as default one for Orchestration. Also, it has the required capabilities (PowerShell). But when I click on TEST INPUT button my custom activity, it picks a different MID Server.