Import Module with custom powershell activity not working

chrisw_
Tera Contributor

HI Together,

I ´m trying to run a custom powershell activity which should Import the lync module on the mid-Server.

Then get the UPN of the user and run some lync commands.

I have installed the lync powershell module on the mid Server and can also Import it directly on the Server.

But anytime i try it within the Orchestration powershell activity i get the following error:

The specified module 'lync' was not loaded because no valid module file was found in any module directory

What i ´m doing wrong ?

My Script Looks like this:

find_real_file.png

Thanks for your help

7 REPLIES 7

Karthik Reddy T
Kilo Sage

Hello Christoph,



Please check the target host is correct or not.


Target host 127.0.0.1 is a loop back address but   it should be Host name or IP address of the target server for this PowerShell activity.



https://docs.servicenow.com/bundle/istanbul-it-operations-management/page/administer/orchestration-a...


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

Hi,



servicenow Support told us to use this ip adress if we want to use the midserver to run scripts.



But for sure i also tried to use the Hostname or IP but the result is the same, he does not recognize the module.


Hello Christoph,



You are running the power shell activity on the   local machine or remote machine?



If it is local machine use 127.0.0.1,


else use the ip address of the host



Refer the below link may helpful to you.



PowerShell Probe and Utility for ServiceNow | John Andersen


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

Hey Karthik,



thank you, but my problem is that the activity does not recognize the lync module for powershell which is intalled on the mid server.



brgds