EPM - Execute Script Policy not working correctly for PowerShell script

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Endpoint Privilege Manager (EPM) Articles
1 min read
L0 Member
No ratings

Question

When a PowerShell script is executed by either Execute Script Policy or Deploy Script Policy, the script will not be executed successfully if the script includes a section where it accesses Microsoft Excel.

If the script is run manually via PowerShell application in the endpoint, the script will be executed with no errors.

Answer

Please note that this is a bug of the Windows OS.
This bug occurs specifically when running an automated PowerShell script that is accessing Microsoft Excel.

Please refer to this blog for more information:
Automating Excel 2007 on Windows Server 2008 64-bit

The solution for this Windows bug can be changed in other OS versions, but it works and have been tested on Windows 10.

The solution goes as follows:
1. In the endpoint, create the following directories:
C:\Windows\SysWOW64\config\systemprofile\Desktop
C:\Windows\System32\config\systemprofile\Desktop 

2. For the created Desktop directories, add Full control permissions for the relevant user.

3. Configure a new Execute Script policy and check if it works by request settings at the affected endpoint.
For Deploy Script policy, execute the script from the Control Panel.

Rate this article:
  • 1696 Views
  • 0 comments
  • 0 Likes
Article Dashboard
Version history
Last Updated:
‎07-31-2025 10:11 PM
Updated by: