Orchestration - PowerShell target host

jwl
Tera Contributor

I'm trying to determine what value (server name) goes into the Target host field in a PowerShell activity.  I've read several responses in the community and also the Orchestration Tips and Tricks but my results don't seem to match what is mentioned in the articles - if I understand them correctly.

Simply put, I can only put the name of the mid server in the Target Host field.  If I put the remote server name as the Target host, I get an authentication error.

If the Target Host is the name of the mid server, I can pass a remote server name in as an input variable and the script runs ok. 

Thanks,

Jerry

Here's a screenshot with some notes.

 

find_real_file.png

 

 

 

 

 

1 ACCEPTED SOLUTION

VivekSattanatha
Mega Sage
Mega Sage

Hello,

 

The concept is simple. Target host doesn't mean your PowerShell script will run on your target. Based on your Target host IP your Orchestration activity will select which MID Server to use.

 

If you use MID Server IP as a Target host then ServiceNow will take the credential of your MID Service. If its other than MID Server IP then it will use the credential from the credential table.

 

I hope this might have cleared your doubt

 

Regards,

Vivek

 

View solution in original post

9 REPLIES 9

Even if you use windows service credentials, you should create a record in Credentials table in ServiceNow.

 

Now if you are using midserver as target host, the midserver service should be started using the windows service credentials.

 

If your target host is a different server than mid server, the midserver service can be started using Local Credentials.

 

When the powershell activity is executed, it tries all the credentials in Servicenow to login to mid server one by one. Whichever works, it takes that and then execute either remote powershell or execute the command on MidServer itself if the midserver service is running on windows service credentials.


Please mark this response as correct or helpful if it assisted you with your question.

VivekSattanatha
Mega Sage
Mega Sage

Hello,

 

The concept is simple. Target host doesn't mean your PowerShell script will run on your target. Based on your Target host IP your Orchestration activity will select which MID Server to use.

 

If you use MID Server IP as a Target host then ServiceNow will take the credential of your MID Service. If its other than MID Server IP then it will use the credential from the credential table.

 

I hope this might have cleared your doubt

 

Regards,

Vivek

 

What if we try to run the script in remote server, in that case do we have to provide the Target host as the remote system ? and in order to run the script if i select the command and try running Hostname its still showing the MID server name. how can we run the command in remote system?

jwl
Tera Contributor

Ok, I think I get it now.  Looks like I just need the credential set up in ServiceNow. 

Thanks for all your help.

Jerry

 

 

jwl
Tera Contributor

Thanks Vivek and sanjivmeher,

I got it now.  Just wish I would have posted my question here earlier.  It would have saved me a lot of time...

Jerry