Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Problem loading module

$
0
0

Hello All

Can someplease help me with the following issue

I have the DataONTAP module installed from the NetApp PowerShell Toolkit

I can load the module manually e.g.

Import-Module -name C:\Windows\System32\WindowsPowerShell\v1.0\Modules\DataONTAP\DataONTAP.psd

or

Import-Module DataONTAP

I can also setup a non interactive windows scheduled task and load the module

I can also load the module when calling via a DOS batch file

now the problem

We use CA AutoSys scheduling software, the CA AutoSys Agent Windows Service runs under the LocalSystem account ( and I think this is where my problem might be)

if I use CA AuthSys to run a DOS batch file (which calls my PowerShell script, as mentioned above running the batch file manual works no issues), then it fails with the following error

Could not import NetApp DataONTAP Module: The error was The specified module 'C:\Windows\System32\WindowsPowerShell\v1.0\Modules\DataONTAP\DataONTAP.psd1' was not loaded because no valid module file was found in any module directory.

I added the following line to my powershell script

write-output @"
Getting users credentials
 
$( [Security.Principal.WindowsIdentity]::GetCurrent() | out-string )

"@

Sending this to the log file like the other output, just to comfirm the username the script was running under was correct and was an authenticated AD user, which is was.

Therefore does not appear to be an issue with the AD user account running the script (e.g. the same user which works when running the script from the command line).

The only difference I can see is when calling with AutoSys, is the AutoSys agent is running as LocalSystem.

I am using PowerShell v2

Any advise most welcome, has anyone else come across these issue before?

Thanks All

Ernie


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>