Applications Systems

PowerCLI commands are not running through using PowerShell component in SAM due to error on Importing VMware module

This article describes how to resolve issue on importing a VMware module using PowerShell script component.

First published date

1/30/2026 4:45 PM

Last published date

1/30/2026 5:17 PM

Overview

When testing a PowerShell component with a PowerCLI command, the test is successful; however, when importing the VMware module, the error "module file was not found in any module directory" occurs.

SolarWinds runs scripts within a restricted Job Object Container. This could be responsible for the "Access Denied" errors. Switching to Remote Host triggers a WinRM session, which creates a standard, unrestricted security context for the Service Account.

Using WinRM (Remote Host) ensures a proper logon session. This should resolve the issue where the process defaults to NT authority\system and will allow the script to run under the correct Service Account identity

Product section

Server Application Monitor

Cause

Due to the execution mode of the component set to Local Host, where process defaults to NT authority\system. In Local Host mode, SolarWinds runs scripts within a restricted Job Object Container. This could be responsible for the "Access Denied" errors. 

 

Resolution

Prerequisites:

Please ensure WinRM is enabled and the Service Account is added to the Remote Management Users group. Run these commands on the target server in an elevated PowerShell window:

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

  • winrm quickconfig
  • Add-LocalGroupMember -Group "Remote Management Users" -Member "DOMAIN\YourServiceAccount"

Resolution

  • Execution Mode: Change from Local Host to Remote Host (leave defaults for other options that will appear: Port/Protocol: 5985/HTTP)
  • Credentials: Assign the designated Service Account (instead of System)
  • Platform to run polling job on: Ensure it is set to the correct bitness of the device (x64 or x86)
  • Preferred Polling Method: Agent