almostIT
Enthusiast
Enthusiast

Horizon DaaS - Run Once Script - Cannot Execute Post-Customization Script. It Was Not Secured.

I've seen people with other version of Horizon struggle to get this right as well, and there doesn't seem to be a definitive solution, other than trial and error with placement of scripts, types of executables, and so on. Which, if you're using instant clones, testing this stuff takes forever, because of the image preparation times. It's a HUGE TIME SUCK, just to fiddle around with the location of a few files or settings. 

See the "debug" log snippet below. 

I have a Powershell script stored in c:\ProgramData\powershellscript.ps1 on the gold - instant clone - image. It's supposed to install an agent on the VM and in normal conditions the installation itself doesn't take more than 20 seconds. I've tested the script itself and I know it works when executed.

The "Run Once Script" command I'm using is this: 

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\ProgramData\powershellscript.ps1

(I've run this exact command in cmd.exe, just to see if it works, and it does) 

The documentation for this feature only has one small paragraph of info with absolutely no details. Only to add a restart function "to the script", and a vague idea of the process involved with its execution. 

 

 

2023-07-11T09:21:39.323-04:00 WARN (0C0C-0C70) <3184> [vmware-svi-ga] svmga::common::windows::registry::ExistingRegKey::ReadDwordValue(): CloneMachinePasswordChanged Does Not Exist
2023-07-11T09:21:39.323-04:00 WARN (0C0C-0C70) <3184> [vmware-svi-ga] svmga::common::windows::registry::ExistingRegKey::ReadDwordValue(): ChangeCloneMachinePassword Does Not Exist
2023-07-11T09:21:39.323-04:00 WARN (0C0C-0C70) <3184> [vmware-svi-ga] svmga::common::windows::registry::ExistingRegKey::ReadDwordValue(): CloneCustomizationCompleted Does Not Exist
2023-07-11T09:21:39.323-04:00 DEBUG (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Customization::OkToCompleteCustomization(): Cloneprep Ready To Complete Customization
2023-07-11T09:21:39.323-04:00 DEBUG (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Customization::OkToCompleteCustomization(): No flags set, completing customization
2023-07-11T09:21:39.323-04:00 DEBUG (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Customization::CompleteCustomization(): Completing Clone Customization...
2023-07-11T09:21:39.323-04:00 WARN (0C0C-0C70) <3184> [vmware-svi-ga] svmga::common::windows::registry::ExistingRegKey::ReadDwordValue(): PostCustScriptSecured Does Not Exist
2023-07-11T09:21:39.323-04:00 ERROR (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Script::RunPostCustomizationScript(): Cannot Execute Post-Customization Script. It Was Not Secured
2023-07-11T09:21:39.323-04:00 DEBUG (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Customization::SetCustomizationState(): Set guestinfo.clone.CustomizationState to error
2023-07-11T09:21:39.323-04:00 DEBUG (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::util::NotifyViewAgent::MarkCustomizationFailed(): Set NotifyVdmStatusValue to CustomizationFailed(5)
2023-07-11T09:21:39.323-04:00 DEBUG (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Cloneprep::CustomizeClone(): CompleteCustomization Failed
2023-07-11T09:21:39.323-04:00 DEBUG (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Cloneprep::CustomizeClone(): Total Clone Customization Time: 20000ms
2023-07-11T09:21:39.323-04:00 WARN (0C0C-0C70) <3184> [vmware-svi-ga] svmga::common::windows::registry::ExistingRegKey::ReadDwordValue(): CloneCustomizationCompleted Does Not Exist
2023-07-11T09:21:39.323-04:00 DEBUG (0C0C-0C70) <3184> [vmware-svi-ga] svmga::core::windows::Customization::CustomizeVM(): Clone Customization Failed
2023-07-11T09:21:39.323-04:00 WARN (0C0C-0C70) <3184> [vmware-svi-ga] svmga::common::windows::registry::ExistingRegKey::ReadDwordValue(): PreShutdownScriptConfigured Does Not Exist

 

Reply
0 Kudos