VMware Cloud Community
philk33
Enthusiast
Enthusiast
Jump to solution

Getting Access Denied in Execution Stack when running external powershell/powercli script

The error I get is:

item: 'Invoke an external script/item0', state: 'failed', business state: 'null', exception: 'PowerShellInvocationError: Errors found while executing script

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

   at System.Management.ThreadDispatch.Start()

   at System.Management.ManagementScope.Initialize()

   at System.Management.ManagementObjectSearcher.Initialize()

   at System.Management.ManagementObjectSearcher.Get()

   at Microsoft.PowerShell.Commands.GetWmiObjectCommand.BeginProcessing()

   at System.Management.Automation.Cmdlet.DoBeginProcessing()

   at System.Management.Automation.CommandProcessorBase.DoBegin()

(Dynamic Script Module name : invokeScript#14)'

I followed microsoft's recommendation of checking the DCOM settings on the server and it didn't have any effect. I also updated the Powershell Plugin and that didn't help either. Sample scripts work but anything that attempt to use a master script that calls other scripts fails because for some reason some of the scripts it calls won't execute.

Same folder permissions across all scripts folders and module folders they rely on.

Anyone else experience this?

Reply
0 Kudos
1 Solution

Accepted Solutions
philk33
Enthusiast
Enthusiast
Jump to solution

What I discovered is that I updated my powershell host to powershell 5.1 and they hadn't updated the vro powershell plugin. So, only Win Server 2016 powershell hosts were working properly with powershell 5.1 and the VRO plugin, and we were only 2012 R2.

It has since been updated and things work properly now.

View solution in original post

Reply
0 Kudos
2 Replies
parmarr
VMware Employee
VMware Employee
Jump to solution

Not sure if this thread helps with what you are looking for get useful vm information with guest OS

Sincerely, Rahul Parmar VMware Support Moderator
Reply
0 Kudos
philk33
Enthusiast
Enthusiast
Jump to solution

What I discovered is that I updated my powershell host to powershell 5.1 and they hadn't updated the vro powershell plugin. So, only Win Server 2016 powershell hosts were working properly with powershell 5.1 and the VRO plugin, and we were only 2012 R2.

It has since been updated and things work properly now.

Reply
0 Kudos