Policies sometimes fail to apply to Windows devices due to a missing PS1 file. This article helps you troubleshoot this error.
Symptoms
The policy fails to apply to the device, and the policy results show an error similar to the following:4294770688exit status 0xfffd0000: The argument 'C:\Program Files\JumpCloud\policies\POLICYNAME.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter
Cause
This error occurs when the .ps1 script files needed to apply a policy are missing from the C:\Program Files\JumpCloud\policies\ directory. This typically happens because:
- File Locking During Updates: When JumpCloud attempts to update policies, it clears the
\policiesdirectory to remove old scripts. If a specific file (such asPolFileEditor.dll) is locked by another process or an active antivirus scan, the agent cannot delete it. This results in an "Access is denied" error that aborts the update, leaving the directory empty of.ps1files. - Antivirus or Firewall Interference: An automated cleanup script or third-party antivirus scan flagged the
.ps1files and deleted or quarantined them from the device. - Accidental Deletion: The scripts were accidentally removed or corrupted by a local user.
Resolutions
Try the following methods to restore the missing policy scripts.
Method 1: Force a Policy Sync
Deleting the corrupted folder forces the JumpCloud Agent to resynchronize and pull down the missing files.
- On the affected device, go to
C:\Program Files\JumpCloud\. - Delete the policies folder.
- Restart the device to trigger a policy sync.
Method 2: Unbind and Rebind the Policy
- In the JumpCloud Admin Portal, unbind the failing policy from the affected device.
- Rebind the policy.
- Restart the device to see if the issue is resolved.
Method 3: Verify Policies Folder
To ensure that the necessary scripts are present, follow these steps:
- Navigate to the Policies Folder: On the affected device, navigate to the following directory:
C:\Program Files\JumpCloud\policies - Verify Scripts: Ensure that the required scripts are present in this folder. When a policy is bound to a device, JumpCloud runs the scripts from this location to apply the necessary changes to the system, including registry modifications.
- If the policy scripts are missing, it may indicate that they were accidentally removed or corrupted.
- When the JumpCloud agent is installed, the scripts for existing policies are placed in this directory by default. If the scripts for the policy you applied are missing, the device may fail to apply the policy correctly.
- Copy Scripts from a Functional Device: If you have another device where the policy is working, you can copy the contents of the
policiesfolder from that device to the affected device. This should restore any missing scripts.
Method 4: Update or Reinstall the JumpCloud Agent
If your JumpCloud agent is running an older version, update it to the latest version. The update process will overwrite the existing policies directory, ensuring that all necessary policy scripts are in place. If updating doesn't resolve the issue, uninstall and reinstall the JumpCloud Agent.
To prevent this issue from recurring, exclude the C:\Program Files\JumpCloud\policies\* path from any automated cleanup scripts and third-party antivirus quarantine actions.
Capture Logs for Further Troubleshooting
If the above steps do not resolve the issue, you can use the JumpCloud Log Collection Script to gather detailed logs for further investigation. See Use JumpCloud Log Collection Scripts to learn more. If the problem persists, capturing the logs will help JumpCloud Support investigate the issue further.