I'm trying to get a simple Powershell script to run as a GPO Startup script on my school's workstations. So far I've not had much luck. The script started life as a more involved set of commands intended to determine whether or not an application was installed, and which version, and then install an updated version if required. None of that worked so I've reduced the script to just two lines to see if the script even runs. It doesn't appear to.
The current code:
set-content -Path c:\PSTests\PSTest.log -value "PSTest script run successfully" exit
This has been installed in a GPO at
Computer Configuration/Windows Settings/Scripts (Startup/Shutdown)/Startup
I can run this in the Powershell ISE if I log in, and the text file is created or updated, but using it as a GPO Startup script has no discernible effect.
I also checked the system logs in
Applications & Services Logs/Microsoft/Windows/GroupPolicy/Operationalwhich reports a List of Applicable Group Policy Objects that includes my script GPO. It also reports starting Scripts Extension Processing and lists my GPO, and completing the processing but reports no errors between these two points.
So, it appears that my policy object is being applied, and that my workstation is making some attempt to process it. However, the file it is supposed to create never appears.
I'm clearly missing something - but what?