PowerShell Group Policy Scripts
» by JeffHicks on Mon 08 Feb 2010 · No replies
Recently I was adding some finishing touches to a chapter I worked up for Jeremy Moskowitz on PowerShell and Group Policy. Some comments had been raised about running PowerShell scripts as logon and logoff scripts and script execution policy. Leaving aside the merits of using PowerShell for a logon or logoff script (that's another article) I discovered something that I'm honestly still not sure about. Confused?
Let's start at the beginning. First off, you need a version of the Group Policy management console running on Windows Server 2008 R2. (I don't have an older 2008 server handy to see if that version works too). When you go to create a user logon script in a GPO, you'll see the setting you've seen since Windows 2000 where you can specify a script path and parameters. Originally I thought this was the only way you could run a PowerShell script. The script path had to be a PowerShell.exe command and any script executed would have followed the execution policy on the client. If the client was configured as Restricted, then your script wouldn't run.
What I failed to notice, or perhaps I was using the wrong GPMC is that there is also a PowerShell script tab.
This setting only applies to Windows 7 and Windows Server 2008 R2 clients. But now I can add a PowerShell script just as I used to with batch files and VBScript. I can store the PowerShell script with the GPO or put i
...continue reading "PowerShell Group Policy Scripts"


4
183
3
2
15
45
20
611
2
3
97
11
1
Welcome to The Experts Community!
We've created this site so that the
general community of Active Directory administrators has a place to ask AD-related questions, as well as
questions related to identity management in general. This is also a repository of content, including
numerous papers and other resources, and links to other useful Web sites, books, and online materials.
We encourage you to participate: Create an account, subscribe to an RSS feed, ask a question, or offer
an answer. Thanks for visiting!