My guess is this an error for the machine nothing to do with Syncro. Try running the command manually on the machine and I bet you’ll get the same error which you’ll need to research to find out why.
I don’t see anything wrong with your script- unless the “path I have specified” isn’t writable by the System account. For what it’s worth- here’s ours that works great:
#TODO - MAKE SURE YOU SETUP YOUR ASSET CUSTOM FIELD CALLED “Bitlocker_Key_” for each drive as a “Text Field” on your
Syncro Device asset type. Assets → Manage Types → Syncro Device → New Field
Based on the Syncro Staff product keys script.
Import-Module $env:SyncroModule
#Creates temp directory if it does not exist
Set-Location C:
md temp
Set-Location C:\Temp
#Puts keys into text files
(Get-BitLockerVolume -MountPoint C).KeyProtector.recoverypassword > C:\Temp\bitlockerkeyc.txt
(Get-BitLockerVolume -MountPoint D).KeyProtector.recoverypassword > C:\Temp\bitlockerkeyd.txt