Forum Discussion
Rambo363636
Jun 26, 2024Brass Contributor
Below Powershell script is not working without running as administrator.
Hi All, I want to change the default font to Verdana on excel to all users on the intune endpoints. But script is not working for some users. When checked directly on powershell i get the below err...
- 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
Thihan_Lin
Jun 26, 2024Copper Contributor
Hi Rambo363636,
My understanding of your post is you are trying to run the script via Intune, and it doesn't apply the changes you make in the registry.
Are you trying to push the script via win32app?
I assume you are running a script in a 64-bit OS with a 32-bit Win app. As a result, your registry path is not correct and throws errors.
If this is the correct scenario, maybe I could help you to resolve this.
Thanks,
Thihan
My understanding of your post is you are trying to run the script via Intune, and it doesn't apply the changes you make in the registry.
Are you trying to push the script via win32app?
I assume you are running a script in a 64-bit OS with a 32-bit Win app. As a result, your registry path is not correct and throws errors.
If this is the correct scenario, maybe I could help you to resolve this.
Thanks,
Thihan