@Anthony Lauckner Thanks for posting in our Q&A. From your description, did you mean that this script works when you run it manually, but it doesn't work when you deployed it via intune? If there is anything misunderstanding, please correct me.
For this issue, we appreciate your help to collect some information:
1.Please show us the screen shot of Script settings in intune portal.
2.Please try to run the scripts in the System account using the psexec tool locally to check if this script still works.
psexec -i -s
https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
If there is anything update, feel free to let us know.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.