3

I have a powershell script that creates an Outlook signature. It is applied via user-assigned GPO. All users are in the same OU, the group policy object is linked to that OU.

GPO:

User Configuration (Enabled)hide
Policieshide
Windows Settingshide
Scriptshide
Logonhide
For this GPO, Script order: Windows PowerShell scripts will run firstName Parameters 
SignatureUnifiedFull v2.ps1

It works flawlessly on Windows 10 devices, but windows 7 devices won't run it (even though it works when I run the script manually on the device).

I ran GPresult /R, and the policy did show up there...

Is there a difference in how windows 7 and 10 run their logon scripts?

3 Answers3

3

I figured it out!

The script has a space in its name. I removed the space and... it works!

I don't know if I should feel stupid for not figuring it out sooner...

2

Might be because of an executionpolicy being set differently in Windows 7. Try to do the following as a test: Create you GPO, containing both a .bat file, with the following line in it:

powershell -noexit -c set-executionpolicy remotesigned -force
c:\pshell.ps1

End your PS script with "set-executionpolicy default -force"

1

We experienced a similar issue with the name. We were in the process of upgrading the environment (application version and moving from server 2008 to 2012) and knew our scripts for GPO worked. Apparently the ps1 file CANNOT contain spaces.

Donma
  • 11