VMware Horizon Community
JF_ID
Enthusiast
Enthusiast
Jump to solution

Post-Sync script always failed

Hi, i'm trying to put a Post-Synchronization Script for an instant clone pool. The File is a simple bat file that call powershell ps1 file. But i always got a error that the script failed. Horizon 7.13.1

 

Log:

2022-04-07T16:01:08.822-04:00 WARN (0C0C-0C70) <3184> [vmware-svi-ga] svmga::common::windows::registry::ExistingRegKey::ReadDwordValue(): PostCustScriptSecured Does Not Exist
2022-04-07T16:01:08.822-04:00 ERROR (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Script::RunPostCustomizationScript(): Cannot Execute Post-Customization Script. It Was Not Secured

 

Batch file content :

PowerShell.exe -NoProfile -ExecutionPolicy Bypass "C:\Tools\Onboard-NonPersistentMachine.ps1"

Any ideas

0 Kudos
1 Solution

Accepted Solutions
JF_ID
Enthusiast
Enthusiast
Jump to solution

Finaly got fixed. 

My script was under c:\@tools\scripts and I change it to C:\Scripts

Two possible fixes : 

1. The path provide doesn't support "@" character

2. The path cannot be more than 1 level from C:\

Wish that help others

 

View solution in original post

0 Kudos
3 Replies
JF_ID
Enthusiast
Enthusiast
Jump to solution

Finaly got fixed. 

My script was under c:\@tools\scripts and I change it to C:\Scripts

Two possible fixes : 

1. The path provide doesn't support "@" character

2. The path cannot be more than 1 level from C:\

Wish that help others

 

0 Kudos
MarcoKaeslin
Contributor
Contributor
Jump to solution

Hello together

For Horizon v.2303 following Inputs in the pool guest customizations are necessary to run Powershell scripts directly:

MarcoKaeslin_0-1681932542909.png

 

Post Sychronization Script Name: Only the executable path of the interpreter aka powershell.exe

Post-Synchronization Script Parameters: the parameters aka -File "Path to your powershell script on Base Image"

What happens ?

In the customization Part of the Instant Clone the interpreter powershell.exe (Post Synchronization Script Name) will be copied to c:\windows\temp\VMware and secured (whatever this means). Your Powershell Script file will remain in his current location. After that the executable interpreter in the c:\windows\temp\Vmware environment will be called with the Post-Synchronization Script Parameters.

Check the debug log file in your instant clone at %ProgramData%\VMware\vdm\logs (debug-[DateTime].txt) for further informations about errors etc. Search for your Script Name inside the debug log file to get the necessary informations quickly (its quite large).

Cheers (wasted a day to get this done).

Marco

 

Rogio
Contributor
Contributor
Jump to solution

You're my hero!

0 Kudos