I've got a script that works. See here.
Now my problem is getting it to run via a domain GPO. On my test clients, I've set the ExecutionPolicy to unrestricted.
I've tried setting it as a startup script. (preferable)
I've tried setting it as a login script.
Nothing is getting executed. If I run it as an admin user manually, it works. No dice via GPO.
Edit: I just tried a test on my XP client that has the Window Management Framework Core (KB 968930) installed. I associated .ps1 with the powershell program; it was previously associated with Notepad. I also set a local gpo that pointed to the script. I rebooted the computer, and it got to the running scripts portion of startup. It hung there for about 5 minutes before getting to the login screen. When I logged in, the program was still installed. No errors in the eventvwr that I can see.
When I was trying to push this out from my domain controller, I went to the Computer Configuration\Window Settings\Scripts and under the Powershell Scripts tab added the file with no parameters. I have yet to try the domain GPO with the file association added on the client.
What am I missing?
2008r2 and 2003 SP2 DC, Win7 and XP clients
Are you setting it to run directly by putting the script path as the "executable"? Or are you setting the executable to powershell.exe and passing the script path with the -File argument (and potentially other arguments like -NonInteractive)?
I haven't actually tested this myself, but I'm pretty sure you should be doing the latter rather than the former.
This looks like a no-go for XP clients. I managed to get my Win7 clients to work after setting .ps1 to associate with PS instead of Notepad.