none
problem with UNC path RRS feed

  • Question

  • Hi, I have a script to scan some workstation parameters. Script have two main paramaters. One is -computer where enter workstation name Second one is -file where as input I give a txt file with workstation names and as an output I recived csv file This script on the begining import some modules located in network share To import module I use following: Import-Module -Name \\serverXXX\foler1\folder2\module1.psm1 -Force When I run this script from cmd , powershell session or batch file then everything works fine. Problems occure when I wanted to run script on remote workstation. For this I have another script which trying to start powershell process with -command parameter via Invoke-WMIMethod on several so called by me processing workstations Invoke-WMIMethod -class Win32_Process -Computer server2 -Name create -ArgumentList $command Command is exactly the same as in interactive mode Process is created on remote machine with return code 0 -> so OK However I recived following: Import-Module : The specified module '\\serverXXX\foler1\folder2\module1.psm1' was not loaded because no valid module file was found in any module directory. I investigate this little bit more and found out that this process can't access UNC path Anybody know why script started via Invoke-WMImethod can't access UNC path ? Other methods to start process on remote computer can't be used by me as long as WinRm is not configured on any machines Regards Chris
    Wednesday, September 21, 2011 1:23 PM

Answers