Forum Discussion
Below Powershell script is not working without running as administrator.
- Jun 27, 2024
Hi Rambo363636
I understand that pain. I assume that is an issue with the 32 and 64-bit versions.
Could you please put the script code below at the beginning of your script and try to push it again?
If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") {
Try {
&"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH
}
Catch {
Throw "Failed to start $PSCOMMANDPATH"
}
Exit
}
Please mark it as resolved if this is the solution for you.
Thank you.
Thihan
I agreed screenshot is wrong. But if i open powershell as administrator and run the script it will work and it will change the excel font to verdana. I have tried both user and machine context deploying in intune. It is working only for some devices and users.
Please let me know if i need to add anything into the above script.
Thanks.
Technically, there's nothing wrong with the script meaning there's nothing PowerShell has to offer you. The issue you're facing is a permissions issue when accessing that particular area of the registry as it's locked down for use by the group policy engine - which makes sense. You have to resolve this requirement through InTune, not PowerShell.
The script will work just fine once the deployment rights issue is sorted out.
Have you tried asking this question in an InTune forum?
Cheers,
Lain
- Rambo363636Jun 27, 2024Brass ContributorHi Lain,
Thanks very much for confirming there is no issue in the script. I will see if any intune champ can assist.
Regards,
Ram